The Carter administration, bowing to intense pressure from Congress and the British government, yesterday ended the 12 years of U.S. trade sanctions against Rhodesia although the civil war there is continuing.

A State Department announcement said the decision, which takes effect at midnight tonight, is based on the belief that the "aims and objectives" of sanctions had been achieved with the arrival last week of a British governor to preside over an election that has been agreed to by all the warring parties.

The administration had clearly expected to time its announcement to a successful end of the London conference on Rhodesia but went ahead despite the last-minute failure there to reach a final cease-fire accord.

Congress had been moving swiftly with a resolution that would have directed President Carter to lift sanctions, and Britain's Prime Minister Margaret Thatcher arrives in Washington today for her first visit since taking office -- a combination of factors that evidently prompted the administration to move now rather than wait any longer for an accord to end the fighting.

Thatcher had been pressing for the administration to act once Britain resumed control over its breakaway colony, which happened last week.

Those in and outside the administration opposed to lifting sanctions at this time argue that progress made thus far could still come undone and leave the United States in a position of supporting the British authorities in Salisbury while the guerrillas fight. Until now the administration has assiduously avoided taking sides in the Rhodesia conflict in order to retain some leverage with all factions.

Claiming to speak for "the national black leadership," Randall Robinson, executive director of a black foreign policy lobbying group, said that in yesterday's move Carter had "broken a clear commitment he made to black leaders."

Robinson maintained in a statement that the president had promised in a meeting last month with 10 black leaders to await a final settlement as well as elections for a new black majority government in Rhodesia before ending the trade embargo.

Senior State Department officials, who declined to be named, said it had never been intended to make the lifting of sanctions "contingent" on all aspects of a Rhodesian settlement being concluded.

The department's announcement said that terms for the new Rhodesian constitution, the transitional arrangements and the cease-fire, as put forth by Britain "are fair and make possible an impartial election leading to a just settlement of the Rhodesian conflict."

In his most recent renewal of sanctions last month, the statement continued, Carterr "stated that he would be prepared to lift sanctions when a British governor assumes authority in Salisbury and a process leading to impartial elections has begun. These conditions have now been met."

Another complication in yesterday's action was advanced by the U.S. ambassador to the United Nations, Donald McHenry, who has contended that only the United Nations, which ordered the sanctions in the first place in 1967, could now rescind them.

While McHenry has not directly commented on the U.S. move, he was critical of Britain's unilateral lifting of sanctions last week, which technically leaves the U.N. punitive measures still in force. Britain was on a "very wrong course," McHenry declared in a memorandum, in acting without "proper" U.N. Security Council action. Presumably his views pertain to the U.S. action as well.

Moreover, the United States is preparing to ask the United Nations to impose economic sanctions against Iran for its seizure of the U.S. embassy in Tehran and the holding of 50 Americans as hostages. At issue is whether the U.N. is undermined when it is asked to impose an embargo jointly which individual governments then choose to end on their own.

State Department officials said yesterday that Rhodesia and Iran were separate cases and should be treated as such.

Sanctions have been a nagging political problem for Carter since a black-led government assumed power in Salisbury in March 1978. Some members of Congress pressed for U.S. moves in support of the new authorities while the State Department argued that the guerrillas should be brought into leadership first so that a real peace would be possible.

The practical impact of ending sanctions is that U.S. businesses can now legally do business again in Rhodesia although officials said it was "virtually inconceivable" that licenses would be granted for the sale of arms.