Their red capes and ceremonial lances flashing in the bright North African sun, two guards at the royal palace burst into a chant as King Hassan II approached their post one day last week.

"God watch over His Majesty," the guards implored as the king passed into the courtyard.

Once the jauntiest and most self-assured of Arab rulers, the Moroccan monarch today treads the palace grounds, exuding a somber, even worried, air. God may be watching over him, but the king has begun to believe in recent months, that the United States no longer is.

After two decades of close cooperation and unquestioning support from Washington for his throne and his policies, Hassan, 48, appears to have been shaken by the Carter administration's failure to renew a warm American embrace that in the past resulted in U.S. military base rights here and diplomatic support for American objectives in Africa and the Middle East.

Still hoping to repair an alliance that he sees as strategically vital for both countries, Hassan declined during an interview Friday with Katharine Graham, publisher of The Washington Post, to voice a direct opinion of President Carter's foreign policy "for fear of offending friends by being too frank."

But his new concerns were evident in all of his remarks. He invited Andrew Young to visit Morocco on his next trip to Africa so that the U.S. ambassador to the United Nations could "get a more clear idea of Africa." Hassan also said that he hoped a state visit to Washington that he called off last December could now be rescheduled.

On other subjects, King Hassan made these points:

Although he was the most vocal Arab supporter of Egyptian President Anwar Sadat's 1977 peace initiative to Israel, Hassan now believes "nothing will happen" as long as Menachem Begin heads the Israeli government. The Israeli response to Sadat's mission "has greatly disappointed me," he said.

Hassan voiced willingness for a new but limited role for the United Nations in the disputed former Spanish Sahara territory, where the Moroccan army has been fighting for two years against a guerrilla movement supported by Algeria.

The West should step up arms supplies and training for friendly African countries to keep pace with growing Soviet efforts and to maintain a strategic balance in Africa that Hassan believes is being destroyed.

"We do not want a single American soldier. But we do need some [material] help," he said.

In many ways, Hassan's doubts about American policy typify those of other conservative or moderate Third World leaders who have been disoriented by the Carter administration's efforts to woo rather than confront radical states and to selectively lessen involvement with some traditional allies.

But Morocco's strategic position at a junction point for African, Middle Eastern and Mediterranean conflicts gives those doubts special weight and, in the king's view, urgency.

He is clearly uncomfortable at being excluded from the inner circles of American friends abroad for the first time since he came to power in 1961. His rule, endangered twice by nearly successful coup attempts, has been bolstered by a still secret military pact with the United States that established American military bases here.

But the permanent American military presence in Morocco has been gradually phased out. The last important facility, the Kenitra communications center, is due to be closed by Sept. 1.

The lessening of direct American interests here comes just, as Hassan had turned to the United States for increased help in putting down a guerrilla war that is increasingly draining the Moroccan economy. Late last year, the Moroccans were rebuffed by Washington when they asked to buy slow flying reconnaisance and bombing 'Bronco aircraft and helicopters to be used in the Sahara war.

Hassan last December abruptly called off a scheduled visit to Washington to meet Carter when it became clear that the arms proposal would probably be shelved.

Hassan said that he had been told that the administration sought to delay sending the arms request to Congress until after the package of war planes for Saudi Arabia, Egypt and Israel had passed.

"I can't see anything, legally and objectively, that would keep the United States from selling us the helicopters" and planes now, he said, adding that he hoped a meeting with Carter could be arranged for early autumn "so my view of the situation can at least be heard."