The House of Representatives voted 219 to 213 yesterday to release $1.5 billion to build 21 additional MX missiles with almost a quarter of the Democrats joining most of the Republicans to side with President Reagan.

Sixty-one Democrats and 158 Republicans supported the resolution authorizing release of the funds, while 189 Democrats -- including the entire Democratic leadership -- and 24 Republicans voted against it.

Reagan needs to win two votes -- yesterday's authorization and a funding measure to be considered today or Thursday -- for the funds to be released. The Republican-led Senate approved the funds last week by a much wider margin.

Rep. Edward J. Markey (D-Mass.), a leading opponent of the MX, said that only three lawmakers would have to switch their votes for the missile to be defeated. "The fight is not over," he said.

"We're going to celebrate tonight and be back in the trenches tomorrow," said House Minority Whip Trent Lott (R-Miss.).

However, MX opponents stopped short of predicting that they could reverse yesterday's outcome, saying that most lawmakers have made up their minds on the issue and that few are likely to change.

The president praised the vote as an "important and unmistakable signal of American unity and resolve . . . a clear demonstration of American strength and determination" affirming "our commitment to maintain the modern forces necessary for effective deterrence and to do everything possible to achieve significant arms reductions."

House action occurred after days of high-powered lobbying on both sides of the issue that culminated Monday when 100 lawmakers were driven to the White House for a personal plea by Reagan and his chief arms negotiator in Geneva, Max M. Kampelman.

Reagan and Kampelman argued that a defeat of the MX would harm the arms talks, a point that apparently swayed many wavering lawmakers. After the White House session with Reagan and Kampelman, MX supporters said they thought the missile might be approved in the House by a margin of 20 or more votes.

Armed Services Committee Chairman Les Aspin (D-Wis.), who closed the debate on behalf of the administration, said, "Why should Congress unilaterally remove something from the table? . . . . We need to give our negotiators something to negotiate with." It would be wrong, he said, "to take something away from our negotiators."

The Democratic leadership, solidly united against the MX for the first time, focused on the budgetary impact of the nuclear-warhead missile, and in the final hours before the debate MX opponents said that appeared to be the major factor in shoring up votes against it.

"Defense should bear its share of the deficit cuts," said Rep. J.J. Pickle (D-Tex.), who in most votes had supported the MX. "If we vote for the MX today it will be almost impossible to realize savings on the defense budget. If we approve the MX we will have lost a clear opportunity to rein in the defense budget."

But Rep. Charles Wilson (D-Tex.) argued, "I'm worried about the image of the Democratic Party. I'm worried about the demise of the Democratic Party. We're seen as the party of isolationism and one that's weak on defense. That's a bum rap."

Democrats in southern states made up a substantial majority of the 61 Democrats who voted with Reagan. Still, a number of them who had opposed the weapon in the past held firm against it under heavy lobbying pressure. Republicans who voted against it primarily were from the Northeast and farm states.

Rep. Tony Coelho (D-Calif.), who heads the Democratic Congressional Campaign Committee, said before the vote that the "fear factor" was persuading many wavering Democrats to vote with the president. That concern was exacerbated this week by reports that the Republicans' campaign committee already was embarking on a campaign to "soften up" many Democrats for the 1986 congressional elections.

At least one Democrat, Rep. Stephen L. Neal (D-N.C.), did not decide to vote for the MX until he received assurances from White House officials that Reagan would halt such an effort.

House Speaker Thomas P. (Tip) O'Neill Jr. (D-Mass.) blamed the "power of the president" for the leadership's defeat on the MX.

"There's about $99 billion out there that the president has the right to spend" on projects that affect lawmakers' districts, and administration officials probably made it clear that an MX vote would be remembered, he said. The tactic, he said, "is as old as the hills."

The vote occurred after two days of debate that reflected the sharp House split on the MX. Administration lobbyists, some with blue caps bearing the insignia "Peacekeeper Flight Team," and anti-MX lobbyists, wearing red "Stop the MX" buttons, kept a nearly constant vigil outside the chamber throughout the debate.

Supporters of the highly accurate, 10-warhead missile argued that it is needed to modernize U.S. nuclear forces and provide a show of strength against the Soviet Union, which has deployed intercontinental ballistic missiles similar to the MX.

But opponents argued that the MX, to be deployed in old Minuteman missile silos, would be vulnerable, the program excessively costly at $40 billion or more and the vote would have little effect on the arms talks because the Soviets have made clear their greater concern is Reagan's proposed Strategic Defense Initiative (SDI) research program into a space defense against missiles