An emergency landing in Spain by a U.S. Air Force F111 bomber returning from the raid on Libya has given an unwelcome twist to Spain's attempts to distance itself from Washington's action and has heightened fears that Col. Muammar Qaddafi may retaliate against U.S. targets here.

The bomber landed at 4:35 a.m. today 11:35 p.m. Monday in Washington at the joint Spanish-American base in Rota, in southwest Spain.

American officials have attributed the emergency landing to mechanical problems unrelated to the actual strike. Reuters reported that the plane dropped its bombs into the sea before the landing.

Prime Minister Felipe Gonzalez said at a press conference that he opposed the "methods employed" by President Reagan against Libya and he called for renewed efforts by the European Community to seek political solutions to avert a further escalation of the crisis.

Gonzalez also said he had told Reagan's special envoy Vernon Walters, whom he met on Saturday, that he would not aid the U.S. in a strike. According to Gonzalez, during the meeting, Walters had suggested "a hypothetical situation" in which American planes would need to pass through Spanish air-space and to be refueled by tanker aircraft stationed in Spain.

The suggestion was rejected out of hand and Walters did not press the issue, Gonzalez said.

Gonzalez said he had not received prior notification of the strikes. Following the terms of a bilateral agreement and international aviation regulations, Spain acceded to the emergency landing request.

But the landing underlined the Spanish government's attitude that it is being compromised by the U.S. action in the Mediterranean. Spain, like Italy, fears the presence of the joint bases on its soil may make the country a potential terrorist target.

Officials from the two governments said last week that they believed they had been explicitly singled out by Qaddafi for retaliatory action should the United States attack Libya.

At their request, the European Community members met in The Hague to discuss the situation just hours before the air strikes.

Last week, Spain recalled its ambassador to Tripoli for consultations after Qaddafi mentioned retaliations.

Spain's sensitivity to the actions in the Mediterranean is dictated by the country's geographical proximity to Libya and by widespread anti-Americanism. The latter was evident during demonstrations last month over a referendum on continued Spanish membership in the NATO alliance and last year when President Reagan visited Madrid.