Neelie Kroes, the EU Competition Commissioner, said restructuring was the only way to secure jobs for the about 3,000 workers at the yard.
"This has been one of the longest and most difficult cases I have had to deal with but I am very pleased that we have now found a constructive solution," she said.
"We have made a tremendous effort to make sure that the yard will be viable for many years to come."
The Commission approves state aid in the 27-nation bloc only under strict conditions and can only authorise such help if it is accompanied by a viable restructuring programme.
Solidarity, the Soviet bloc's first free trade union, was founded at the Gdansk shipyard in 1980.
The union helped end Communist rule in Poland in 1989 and one of its founders, shipyard electrician Lech Walesa, went on to become Poland's president.
Since 2002, the Gdansk shipyard has benefited from aid measures such as capital injections, guarantees, loans and tax write-offs designed to help it survive.