Senate and House committees delivered a painful foreign policy blow to the Carter administration yesterday by voting to halt the planned shipment of 38 tons of nuclear reactor fuel to India.

The action of the House Foreign Affairs Committee, taken by voice vote after brief debate, was expected.

The Senate Foreign Relations Committee action, by a cliffhanger 8-to-7 vote, was a surprise, however, especially after unusually intense efforts by the administration to win support among the senators.

Among other things, the vote was a personal blow to Secretary of State Edmund S. Muskie, who spent well over an hour in the back room of the committee chambers just before the vote in an effort to persuade his former colleagues to permit the nuclear fuel shipment to proceed.

With the committee split, 7 to 7, it was Sen. Paul Tsongas (D-Mass.) Muskie's replacement on the committee when the then-Maine senator became secretary of state last spring, who arrived late to break the tie and dispel the suspense.

Committee aides and administration officials identified Sens. Claiborne Pell (D-R.I.) and S. I. Hayakawa (R-Calif.) as the real "swing votes." Both had been considered likely to wind up in the pro-shipment column, but both voted in opposition.

The administration's last chance on behalf of the controversial fuel supply in a Senate floor battle later this month. The full House is considered a lost cause. A majority vote of both houses is needed to prohibit a nuclear export.

The loss in the Senate committee is certain to make it more difficult for the administration to reserve the decision on the Senate floor. Senate Department officials took some solace from the fact that the senior members of the Foreign Relations Committee and many of the Senate's most senior and influential figures on foreign and defense issues are backing the administration.

Assistant Secretary of State J. Brian Atwood said there is "no chance" that the administration will withdraw its order for the export rather than be defeated on the floor of Congress. Both proponents and opponents anticipated a major lobbying campaign on the issue in the days leading up to the Senate vote.

The issue as drawn by opponents of the export was the credibility of the 1978 Nuclear Non-Proliferation Act as well as other aspects of the U.S. drive to halt the spread of nuclear weapons.

India, whose 1974 nuclear blast touched off worldwide alarm about proliferation, has refused to comply with provision of the act, which insists that all of the nation's atomic facilities must be placed under international safeguards to qualify for the receipt of U.S. nuclear materials.

Opponents of the export, led by Sen. John Glenn (D-Ohio) and Rep. Jonathan Bingham (D-N.Y.), also maintained that India, while disappointed, will take many other factors into consideration in its future relations with the United States.

Muskie, other administration officials and legislators on the other side argued that prohibiting the export of fuel the atomic reactor at Tarapur, which provides electricity for Bombay and western India, will do more harm than good for the objective of nonproliferation.

The consequences of U.S. failure to provide the fuel, in this view, may include the decision by India to consider earlier nuclear agreements with the United States to be void. Such an act could end semblance of U.S. control over the uses of nuclear material provided by this country to India in the past, as well as deliver a sharp blow to the international system for controlling the use of nuclear materials.

In view of the emotion that has come to surround the issue in India, failure to supply the fuel may bring a serious crisis in U.S. relations with the largest country in South Asia, advocates of export argued.

In an 11th-hour effort to convince wavering senators, the administration agreed to withhold part of the planned shipment for about a year and give other assurances. These concessions, brought to the Capitol yesterday morning by Muskie, were not enough to convince the opponents and doubters.