The Democratic-controlled House rejected President Reagan's $100 million aid package for the Nicaraguan rebels by a margin of 12 votes yesterday, winning the first round in a bruising political battle with the White House that both sides agree is far from over.

Sixteen Republicans, defying intense pressure from the administration, joined 206 Democrats to defeat the proposal, 222 to 210.

The margin was wider than predicted and a clear personal and political setback for Reagan, who made a national television address Sunday and personally lobbied lawmakers until the last minute in an attempt to gain passage of the measure.

At the same time, there were widespread predictions that Reagan still stands a good chance of winning some form of aid, including military assistance, for the rebels from Congress this year. A large bloc of moderate-to-conservative Democrats who stuck with the House leadership yesterday have made clear their desire to find a compromise formula to aid the counterrevolutionaries, also known as contras.

The battleground now shifts to the Republican-controlled Senate, which Majority Leader Robert J. Dole (R-Kan.) said will vote on the contra aid by next Thursday. Dole predicted the administration will prevail in the Senate.

In a statement, the president also predicted ultimate victory, vowing "to come back again and again until this battle is won, until freedom is given the chance it deserves in Nicaragua."

Yesterday's House vote, Reagan said, was "a dark day for freedom. This vote must be reversed . . . . The American people are beginning to awaken to the danger that is emerging on their doorstep, and one day, in the not too distant future, that awareness will come home to the House of Representatives."

Senate Minority Whip Alan Cranston (D-Calif.) did not dispute the predictions of an ultimate administration victory, but said the House vote "will strengthen the anticontra sentiment among senators who have doubts about how they will vote." Cranston said his latest figures showed 48 senators for the aid, 41 against and 11 undecided.

According to Dole and Senate Foreign Relations Committee Chairman Richard G. Lugar (R-Ind.), who met with Reagan immediately after the House vote, the president has agreed to incorporate into the legislation the Senate will consider the contents of a proposed executive order governing how the aid to the contras would be disbursed.

Lugar said Reagan's position on this "evolved" during the day. Several House members told Reagan they would vote with the administration if the executive order were put into law, and Reagan agreed to this in an Oval Office meeting with Senate leaders after the contra aid was defeated in the House, Lugar said.

The executive order, proposed by the White House Wednesday night, was a last-minute attempt to win over the few extra votes thought necessary for the aid to clear the House. The administration pledged that once the package was approved by Congress, Reagan would issue an executive order delaying delivery of most of the $70 million in military assistance for 90 days while diplomatic efforts were made for a peaceful resolution of the contras' conflict with Nicaragua's Sandinista government.

The aid package also includes $30 million in nonlethal humanitarian aid for the contras.

GOP congressional leaders said this move picked up seven or eight House votes, but the Democratic leadership countered with its own offer that held enough wavering Democrats in line to defeat the Reagan request yesterday. House Speaker Thomas P. (Tip) O'Neill Jr. (D-Mass.) promised these lawmakers that they would have a chance to propose an alternative contra aid package as an amendment to a supplemental appropriations bill due to be voted on April 15.

"Sure it helped them," Rep. Dick Cheney (R-Wyo.), the chairman of the House Republican Policy Committee, said of the Democratic leadership offer. White House officials said the second-vote pledge cost them four critical votes and produced the loss. By late Wednesday, the White House knew it had lost in the House, officials said.

"McCurdy bought it along with other people susceptible to cheap shots," Cheney added, referring to Rep. Dave McCurdy (D-Okla.), one of the key swing Democrats who want a compromise and voted against Reagan yesterday.

Before the vote, Cheney said the administration needed the support of 50 Democrats (it ended up with 46), and that if there were more than 12 Republican defections "we've got problems."

He also said that if it was clear that the administration was going to lose, the final margin would probably widen because "you don't like to put the hammer down on somebody unless you know you're going to win."

While the floor debate was reaching an emotional climax, the intense, behind-the-scenes lobbying continued to the last minute. Reagan and Vice President Bush talked on the telephone throughout the day with lawmakers. Meanwhile, Secretary of State George P. Shultz, joining White House lobbyists and Assistant Secretary of State for Inter-American Affairs Elliott Abrams, spent about two hours in face-to-face lobbying on Capitol Hill.

In the end, however, several lawmakers the administration hoped to win at the last minute voted no. These included Reps. Olympia J. Snowe (R-Maine), Mario Biaggi (D-N.Y.), Cecil Heftel (D-Hawaii), Larry J. Hopkins (R-Ky.) and James Ross Lightfoot (R-Iowa). Heftel, and perhaps others, received a letter from Reagan yesterday, according to GOP sources.

Before the vote, O'Neill made it clear that yesterday's showdown on the House floor was largely a case of preventing an immediate, outright administration victory on the divisive contra aid issue.

"If the president wins, it's all over," he said. "If the president loses, it's an ongoing situation."

Others agreed with this assessment.

"Since this was as close a vote as it was, there is a real possibility that some kind of alternative will prevail," said Rep. Michael D. Barnes (D-Md.), chairman of the House Foreign Affairs subcommittee on Western Hemisphere affairs and a leading opponent of aid to the contras.

However, yesterday's House vote apparently assured that any aid to the contras will be delayed until at least mid-April, a development that the administration warned could endanger the existence of the rebel force. House Minority Leader Robert H. Michel (R-Ill.) quoted an unnamed National Security Council official as telling him, "Bob, if we lose that vote [in the House], Nicaragua is lost."

A new compromise presumably would be offered -- along with other alternatives -- as an amendment to legislation pending in the House. Thus, yesterday's battle could be fought all over again in the same arena.

The floor debate, which began on Wednesday, ended at midafternoon yesterday with often emotional appeals. Rep. Lee H. Hamilton (D-Ind.), the chairman of the House Permanent Select Committee on Intelligence, said, "The advocates of aid to the contras overestimate what war can do and underestimate what diplomacy can do."

Recalling the rise to power of Fidel Castro in Cuba, Rep. Claude Pepper (D-Fla.), 85, his voice rising, asked the House, "Do we want to face that situation again?

"We are talking about the character of our hemisphere," Pepper said. "We will not tolerate communism being the dominant character of any country in the Western Hemisphere. Join us, and throw these communists out."

O'Neill and Michel, the House party leaders, closed the debate.

Calling the vote "a matter of conscience," O'Neill attacked the administration's tactics during the battle, comparing them to "that dark era of fear" in the 1950s when there were frequent accusations of communist infiltration of the government.

Michel retorted to the Democratic arguments and, turning to O'Neill, a personal friend and golfing partner, said, "Mr. Speaker, I love you, we're great friends . . . but I just have to say today that you're wrong, you're wrong, you're wrong."

Throughout the debate, Democrats heaped criticism on White House communications director Patrick J. Buchanan, the architect of the administration's hard-line tactics.