WARSAW -- The independent trade union Solidarity came in from seven years in the political cold Wednesday, joining in a historic agreement with Poland's Communist government that paves the way for the first free elections here since World War II and ensures Solidarity's reinstatement as a legal union.

The agreement concluded nine weeks of grueling negotiations between Solidarity and the government and capped a turbulent year in Polish political life that began with a series of strikes last April, which led to Solidarity's return as an active force in the nation's affairs.

"I think the round-table talks can become the beginning of the road to democracy and a free Poland," Solidarity leader Lech Walesa said, "and hence, we look with boldness and hope into the future."

'A Social Contract'

The leader of the government delegation, Minister of Internal Affairs Czeslaw Kiszczak, called the accord "a social contract." He added: "We declare the will to fulfill honestly the agreement that we symbolically conclude today."

In Washington, White House Press Secretary Marlin Fitzwater called the accord "a great day for the Polish people and for freedom." Fitzwater said President Bush is "very pleased by the accords that have started Poland on this new path toward reconciliation."

Asked whether the United States would now be willing to expand trade and commerce with Poland, Fitzwater replied that "now that we have these accords, we are considering issues or moves that might be taken which would, in various ways, foster economic development and help move that process forward."

"I don't have a timetable," he said in response to another question, "but . . . hopefully within the not-too-distant future, we'll have something to announce."

Snags Delay Signing

The signing of the document was delayed for about three hours by last-minute procedural wrangling with the official trade union federation OPZZ, which declined to join in a wage indexing plan to combat the effects of inflation.

Negotiators for the government and Solidarity, however, had already agreed on the issue, and the signing ceremonies finally resumed after the OPZZ chief, Alfred Miodowicz, was allowed to break the planned sequence of speakers to warn against economic measures that "break the bones of the workers."

The agreement covers three major areas--trade unions, politics and economic reform--that put Poland once again in the forefront of change in the Soviet Bloc.

Trade unions, including Solidarity, will be legalized by amending the legislation that banned Solidarity in 1982. The revised law is expected to be passed by the Sejm, the Polish Parliament, on Friday, and Solidarity could be registered officially within days.

Political reforms include a new election law for the Sejm and for the creation of a 100-seat Senate, whose members will be chosen in free and fully competitive elections. Elections are expected to be held in June.

A new office of president is to be created, and the first holder will be the Communist Party leader, Gen. Wojciech Jaruzelski. The president will have broad powers to initiate legislation and dissolve both houses of Parliament. He also will be commander of the nation's military forces.

All Senate Seats Open

According to the plan worked out by Solidarity and the government, 65% of the seats in the Sejm will go to the Communist Party and its allied parties, with the other 35% open to non-party candidates.

All of the seats in the new Senate will be open to fully competitive elections. The Senate will have power to veto legislation but not to initiate it. The Sejm will be able to override a Senate veto with a 65% majority.

While the Senate's powers are limited primarily to the veto, political observers believe that it will have a significant moral voice since it will be the first freely elected parliamentary body in the East Bloc.