By Patricia Kowsmann

LISBON--German Foreign Minister Frank-Walter Steinmeier said Wednesday that Europe as a whole will lose if Greece leaves the euro.

"I don't know what it would mean for Europe if it can't solve its problems with the tools it has available," the official said at a conference in Lisbon.

"If Greece leaves the eurozone, there won't be winners," he said earlier in a news conference.

Mr. Steinmeier, however, said while Germany favors a solution for Greece, that country "needs to do its part."

He said he recently met Greek Prime Minister Alexis Tsipras, who is conscious of the dangers his country faces in the case of an eurozone exit.

Mr. Steinmeier, however, said he isn't sure Mr. Tsipras has a majority within his own party.

He also said a referendum in Greece to decide on whether the country is willing to do what it takes to stay in the euro wouldn't be effective, given the parliament there would still have the ultimate power to approve any plan.

Mr. Steinmeier's Portuguese counterpart, Rui Machete, also warned the EU project would be hard-hit if Greece were to leave the common currency.

The Portuguese government has been a sharp critic of the Greek government's approach, saying austerity is necessary for a country to be fiscally disciplined.

Comments from government officials lately, however, have signaled Portugal is worried about the political impact of a 'Grexit.'

Write to Patricia Kowsmann at patricia.kowsmann@wsj.com