Solidarity leader Lech Walesa on Friday asked striking miners in southwestern Poland to return to work, and hundreds of port workers in Gdansk protested a management decision to fire strikers.

Prime Minister Zbigniew Messner arrived unannounced at the nearby Borynia coal mine, Polish media reported. The mine was on strike from Aug. 20-24 and labor tensions have persisted there. No further details of the visit were available.Five other enterprises remained on strike after Walesa appealed for an end to the work stoppages that began Aug. 16. to open the way for talks with the government on workers' demands, including legalization of Solidarity.

Mine spokesman Antoni Pilny said Walesa began talks with strikers immediately after he arrived at the mine at 11 a.m. accompanied by an aide and his parish priest Rev. Henryk Jankowski. Walesa spoke at a rally in a meeting hall attended by all the strikers, which was broadcast over the loudspeaker system throughout the mine, Pilny said.

The rally ended shortly after 4 p.m., said a Polish journalist at the scene, but there was no immediate word on the miners' decision.

Earlier, the striking miners said they would not stop their strike unless Walesa came to the mine to explain his decision calling for an end to strikes.

In Gdansk, 700 workers gathered at the port this morning after management told about 400 involved n the strike action not to return to their jobs, Gdansk Solidarity spokesman Bogdan Borusewicz said.

Management told the workers to file applications for reinstatement but most of them went back to work, the spokesman said.

Strike committee leaders were negotiating with port authorities to secure formal reinstatement. No agreement had been reached, he said.

In the Baltic port of Szczecin, striking dock workers resumed talks with management over pay issues. Striking bus workers there sent a letter to Interior Minister Gen. Czeslaw Kiszczak asking for his help to obtain a guarantee of job security for strike leaders.

Walesa called for an end to strikes after meeting Wednesday with government officials to discuss the labor unrest - Poland's worst in seven years.

In the meeting - Walesa's first with with ranking officials in six years - the government agreed to discuss the outlawed Solidarity trade union movement.