The Spanish left used to call him " Juan Carlos the Puppet." To the right he was Juan Carlos the Fool." Even those who liked and supported him wondered whether he would turn out to be "the Brief."

But after three days of seeing separatist problems and violence at close quarters this week and dealing with them adeptly in the first royal visit to the Basque country, the king of Spain is now being acclaimed "Juan Carlos the Brave," and critics and supporters alike acknowledge that his popularity is at an all-time high.

After an indifferent begining with scattered protests and a hostile demonstration during a major speech at Guernica, Juan Carlos' visit gathered momentum as he made clear his committment to democracy, and it ended Thursday with the king and the leader of the autonomous Basque government embracing effusively as Juan Carlos left to return to Madria.

In visiting the Basque country, Juan Carlos toured the region that has been the most destabilizing factor in the transition from Francoism's dominant central government to the present policy of autonomy for nationalist groups within a unified Spain.

Political killings in the Basque country in 1980 stood at a record high of 110 with Basque separatists of the Marxist organization ETA claiming responsibility for about 80. Adolfo Suarez, who resigned as prime minister last week, consistently had advised the king against such a tour for security reasons. Reliable sources said the trip was undertaken on the king's own initiative and organized directly with the autonomous Basque government.

In the Basque country Juan Carlos succeeded in driving a wedge between the moderate Basque nationalists that form the autonomous regional government and the extremists who back the terrorist methods of ETA and seek secession of the Basque country from the rest of Spain. The extremist demonstration at Guernica outraged the moderates while the conciliating pitch of the king's speech broke through the mutual suspicion that has dominated their contacts with the central government.

The concluding impact of the first royal trip to the politically charged Basque country of northern Spain has been an undoubted personal triumph for the 43-year-old Juan Carlos, who came to the throne five years ago. Ironically it was leftist extremists who made the triumph possible and, with fortunate timing, the king's stock is at its greatest when he needs it most -- as he prepares to choose a successor fo Suarez, architect of the Spanish transition.

The high point of the Basque trip was the speech at Guernica, the spiritual capital of the fiercely independent Basques. Guernica was blanket-bombed by the German Luftwaffe in 1937 as Hitler backed Franciso Franco's civil war against the Spanish republic.

Juan Carlos, with his wife, Sofia, entered the ancient stone-walled assembly hall preceded by wigged mace bearers in livery and accompanied by thundering clarion calls. When his turn came to address the assembly of Basque politicians, radical nationalist deputies leaped to their feet, gave the clenched fist salute and sang a Basque separatist anthem until they were forcibly ejected by Basque security agents. Juan Carlos bore out the pandemonium with aplomb and when order was restored he restated his faith in democracy and his confidence in the Basque people.

The king spoke at length about the ancient ties that the kings of Spain had forged with the Basque people and how those ties were strongest when Basque freedoms were most observed by his royal ancestors. Politicians of all shades of opinion saw it as a speech of major political importance. Juan Carlos had committed the crown unequivocally to the post-Franco democratic process and especially to the delicate policy of creating autonomous regions that will replace the previous repressive centralism with as virtual federal state structure.

Juan Carlos returned to Madria to an enthusiastic welcome from crowds that were furious at the affront that he had undergone in Guernica and delighted that he had carried off the tense situation in a masterful manner. Newspaper headlines called him "Juan Carlos the Brave."

He also returned to a political vacuum.

With Suarez resigned and the ruling Union of the Democratic Center holding a national convention on Majorca this weekend to find a successor, Juan Carlos has been called on to play to the full his delicate constitutional role of naming a new prime minister after consultation with the political parties.

The king is awaiting the outcome of the Majorca convention to name the successor, the man he chose in 1976 to speed up the democratic process. In the meantime he is consulting with political leaders in an effort to assure his candidate for premier of a strong backing that will ensure a stable government until general elections, scheduled for 1983.

The Union of the Democratic Center lacks an overall majority and Suarez's successor will have to woo minor regional parties to back his program.

Modeled on the British monarchy's tradition of "giving and receiving advice," Juan Carlos' powers are in theory severly limited, but in practice they can be used with considerable muscle. Spanish commentators point out a key difference from the British system: the lack in Spain of consolidated democratic institutions with the corresponding degree of influence that the Monarch is expected to exert.

Profound problems remain unsolved in the northern provinces, the chief one concerning an amnesty for the 200 Basques condemned on terrorist counts or awaiting trial. The Basque autonomous government leader, Carlos Garaikoetxea, made a pointed reference to amnesty at Guernica and the slogans at all the demonstrations against the king centered on the issue.

Garaikoetxea, however, was the first to term the tour "a historic and positive" success. His effusive backslapping embrace, Spanish style, with the king as Juan Carlos left San Sebastian airport to return to Madrid, linked the chief of the Basque executive with the fortunes of the crown and by implication with the rest of Spain.

For all the problems that remain in the Spanish-Basque relationship, Juan Carlos has taken a considerable step toward their resolution, in the view of observers here. At a time of political bacuum, they say, he has given the Spanish people a sense of stability and has shown a reassuring moral authority.