Polish shipyard workers tentatively agreed today to return to work here following a three-day strike that has brought this key member of the Soviet Bloc to the brink of its gravest crisis since bloody workers' riots 10 years ago.

But the workers voted to end the strike and their occupation of the yard only after receiving a large pay increase and assurances from management of labor reforms, including recognition of new workers' representatives. In addition, the workers' strike committee at the Lenin Shipyard in the center of Gdansk decided unilaterally to form an independent all-Poland trade union congress to replace the present Communist-dominated official organization.

The Lenin Shipyard, with 16,000 workers, was the focal point of the labor unrest in Gdansk, which spread to other sectors of the economy and virtually paralyzed the city for the last two days.

Until now, Polish workers have refused to talk to foreign journalists at the sites of strikes. But for about eight hours on Friday, I was allowed to sit in on the negotiations at the Lenin yard between workers and management. It was known I was a Western journalist, and the proceedings were translated for my by an interpreter. The result was an insight into the pent-up grievances of Polish workers that have been released in a surge of bitterness against the Communist authorities.

The workers' demands centered on higher pay, reinstatement of dismissed workers and improved supplies of meat and other basic commodities. And, despite official denials, I also discovered that there is an important political component to the workers' grievances.

During the negotiations, which mirrored similar talks at other plants along the Baltic coast, the strike committee called for the release of all political prisoners, access to the official news media, and independent collective bargaining structures.

The tactic of authorities has been to pay whatever it costs to get workers back on the job but to reject out of hand demands for political reform. Whether the workers' independent trade union congress will be allowed to function is unclear. Poland has long depended on party-dominated unions to restrict the scope of labor's demands, and earlier this week a member of the ruling Politburo said Poland would never adopt a free-market economy -- meaning a free labor market.

The bargaining at the Lenin Shipyard took place in the conference center where party meetings are frequently held. Some of the proceedings were broadcast by loudspeaker to the crowds of workers who occupied the plant immediately after the strike began. Outside the hall, there was a constant echo of cheers and boos as management made concessions or resisted the workers' demands.

There were scenes of deep emotion, such as when strike leader Lech Walesa led the workers in singing the Polish national anthem at the end of every bargaining session. There were also mements that seemed like a highstakes poker game -- at one point he threatened to call off the talks immediately on the issue of discrimination against fired workers.

There was good humor, too. At one point, the strike committee was discussing its demand for the building of a monument to the workers killed in 1970 (a demand accepted by management). One striker drew laughter and applause when he suggested that they build the new monument out of a life-sized statue of Lenin that brooded over the hall.

The strikes along the Baltic coast have been the climax to a wave of strikes in Poland that began when meat prices were raised July 1. Years of latent discontent among Polish workers surfaced in a full-scale challenge to the authority of Communist Party chief Edward Gierek, who flew back to Warsaw Friday after breaking off a vacation by the Crimea.

Ironically, Gierek owes his own rise to power to workers' riots in Gdansk in December 1970 that led to 55 deaths and toppled the regime of his authoritarian predecessor, Wladyslaw Gomulka.

Unlike Gomulka, Gierek carefully refrained from ordering police to crush the strikes, preferring negotiation to confrontation. The decision reflected a changed political climate, for this time the shipyard workers were better organized, more suspicious of official promises and, above all, more aware of their political power.

But this feeling of strength was tempered by a sober determination not to allow the present unrest to get out of hand and provoke a full-scale intervention by the Soviet Union. As one strike leader remarked: "We feel we could bring the present regime to its knees -- but all we want is for our justified demands to be met."

The strikers appointed their own activists to keep order at the Lenin plant. Red or white armbands were the insignia of a strike committee official -- and no outsiders were allowed past the gates without the committee's permission. Food supplies were delivered by sympathizers outside the plant, and the cafeteria was kept running to feed the 8,000 or so workers taking part in the sit-in. They spent most of their time lying around on ripped-up pieces of asbestos.

Some passing motorists sounded their horns and gave clenched-fist salutes of support to the strikers sitting on walls around the shipyard. Elsewhere in Gdansk, there were similar scenes at other factories. Long lines formed outside breadshops when the city's bakeries also went on strike. Public transport came to a standstill when the exception of the overworked taxi service.

Public opinion was clearly on the side of the strikers, but many Gdansk citizens kept away from the shipyard, evidently fearing disturbances. One taxidriver said he had lived through the 1970 riots and did not want to repeat that experience.

Communications with the outside world, and even the rest of Poland, were cut off or delayed by the authorities in an apparent attempt to prevent detailed news from leaking out while negotiations were still in progress. To file this dispatch, I drove 200 miles back to Warsaw.

Despite the absence of telephone links, the Lenin Shipyard strike committee succeeded in making contact with other factories in the Gdansk region. The plant backs onto the Northern Shipyards, where 8,000 workers went on strike Friday morning and also the drydocks with 7,000 striking workers. Delegations passed between the different plants in electric cars used by plant supervisors for internal communications.

The management tactic has been to isolate each strike as much as possible and attempt to divide the workers. At one point on Friday afternoon, that tactic appeared to be succeeding after plant director Klemens Gniech offered a complicated deal of different pay raises to different groups of workers.

The strikers' committee began arguing within itself over the proposal, with one delegate complaining: "They throw us a bone and we fight over it like dogs."

Fearing that the committee hall was bugged by the management, strike leaders moved outside to continue discussion of their own tactics. It was finally agreed to stick to a demand for a single raise of 2,000 zlotys ($68) a month for all workers.

By Friday evening, when talks were suspended, the differences between the two sides were narrowing. Gniech was offering 1,200 zlotys a month for all workers and the strikers were privately prepared to accept a compromise of 1,500 zlotys.

Despite the strikers' wish to meet with higher Communist Party officials, it was plant director Gniech -- flanked by the shipyard's Communist Party secretary -- who conducted most of the bargaining. The suits and polished shoes of the management delegation contrasted with the dirty brown overalls and grimy hands of the workers' representatives. Occasionally allowing himself a thin, strained smile, Gniech adopted a conciliatory tone.

But his appeals to the strikers to think of the economic consequences of their actions (each day's stoppage was said to cost the Lenin Shipyard alone over $1 million) got nowhere. One delegate grabbed the microphone and shouted: "You're always trying to blame us for the mess we're in. In fact it's the Communist Party that is to blame."

When Gniech suggested that the talks should proceed by negotiation rather than ultimatum, another worker retorted: "We've been negotiating with you for the past 30 years and look what good it's done us."

The plant director looked glum when the decision to form a new trade union congress was announced to him as a fait accompli. The workers also began electing the presidium of the congress. Unable to secure the dissolution of the official trade unions (which are taking no part in the present talks) they have decided instead to set up their own representative bodies. But whether management will negotiate with these bodies now that the strike is over remains to be seen.

The Lenin Shipyard settlement included a $50 monthly wage increase, about a 12.5 percent annual raise; a promise of normal pay for the days of the strike, and written pledges to each worker from Gdansk's ranking Communist Party official that no retaliation would be taken.

A key problem for the workers was communicating with each other. Here an important role was played by the dissident Workers' Defense Committee, which has been running a kind of information service on the strikes.

Defense committee activists have frequently been dismissed as intellectuals with few real links with the workers. But at the Lenin Shipyard, the local representatives were admitted as observers to the negotiations and were greeted with loud applause.

In private talks, workers at the plant spoke of some of their personal grievances against the management. One complained that despite working at the yard for over six years, he had still been unable to find an apartment. He lived with his wife and three children in a hut at a public project.

The biggest grievances were inflation and the difficulty of finding even basic foodstuffs in the shops. Enormous energy is devoted by millions of Polish families just to find enough to eat from day to day. According to a recent sociological survey, every Polish woman spends an average of 130 minutes standing in line every day.

Asked what he thought of Gierek, one striker shrugged: "It would be good if he went because it would show our power. But I have nothing against him personally. He's under pressure from the Russians."

The way the strike started reflects the fact that, in Poland's tense economic and political climate, it can take just a small spark to cause a general explosion. The shipyard workers were unhappy over what they considered to be incessant rises in prices and poor living conditions.

But the actual occasion for the strike was management action against an elderly woman crane operator at the yard. Anna Walentynowicz, who helped launch a committee for free trade unions on the Baltic coast. She was a member of the workers' delegation that met Gierek after the 1970 riots and has been in frequent conflict with the authorities since then.

Early on Thursday morning, leaflets and banners appeared at the yard protesting a decision to transfer Walentynowicz to a position outside the city. For a time it looked as if the protests would subside, but then Lech Walesa -- another dismissed free trade union activist who was also one of the strike leaders in 1970 -- climbed over the wall of the plant and began a speech to the workers.

The center of the initial disturbances was the shipyards' hull-building section. It quickly spread to all other sections and in initial demand for a 1,000-zloty pay increase was rapidly raised to 2,000 (Wage rates vary from 3,500 zlotys to over 13,000 zlotys a month).

Walentynowicz was brought to the plant by the management and joined the negotiations. By Friday evening, under intense pressure, the director agreed as "a gesture of goodwill" to reinstate both her and Walesa in their old departments. The strikers insisted that the verbal agreement be committed to writing.

The news of the strike at the Lenin plant -- the pride of the Polish ship-building industry -- in turn provided the necessary impetus for the strike to spread along the coast.

Heading back to Warsaw, my taxi-driver and I listened over the car radio to Prime Minister Edward Babiuch addressing the nation in grave tones. He admitted serious economic difficulties, but held out little hope for any major improvements in living conditions. He reminded his listeners that "our friends" -- an obvious reference to the Soviet Union -- were watching the situation closely, but wanted Poles to sort out their problems for themselves.

By the standards of a Communist country, the 25-minute speech in which Babiuch appealed for tolerance and calm was virtually unprecedented. Our driver simply crossed himself sarcastically at the end and swore at the car radio when Babiuch made his only promise: that meat prices will not be raised again until the autumn of next year.