Miloš Zeman will be joining China's commemoration of the end of World War II | EPA ‘Jiang Zeman’ The Czech president makes a controversial pilgrimage to China.

PRAGUE — Twenty-seven of the EU's 28 countries are boycotting China's commemoration of the end of World War II.

Meet the exception: the Czech Republic's Miloš Zeman.

The Czech president will be in Beijing later this week, thumbing his nose — not for the first time — at the attempts of the rest of the European Union to forge a common approach to foreign affairs.

The Europeans object to the military parade at the commemoration on Thursday, seeing it as a provocation toward Japan at a time of tensions over territorial disputes in the East China Sea. The sight of thousands of troops marching through Tiananmen Square, the site of the 1989 massacre, also discomfited the EU.

The EU had agreed to shun the event at a working-group meeting in early June, and foreign ministers discussed the issue later that month. It never came up for a formal vote at the European Council, where the Czechs, like any EU member, could have vetoed it.

An EU spokesperson said by email that the bloc "pays tribute to the enormous sacrifices made by the Chinese people” but added: “Reconciliation should be paramount.”

Zeman will attend the commemoration of the 70th anniversary of the Japanese surrender as well as the military parade.

The president's spokesman, Jiří Ovčáček, said that Zeman “is for a common [EU] foreign policy.”

"Zeman was invited by the Chinese president two months ago — it’s a celebration of the end of World War II," Ovčáček said. "This is about diplomacy — it’s about a new relationship between the Czech Republic and China."

The Czech president is no stranger to controversy.

Zeman was one of the few EU leaders to travel to Moscow for its May 9 World War II victory celebrations, boycotted by most of the bloc because of Russia's annexation of Crimea and its support for a separatist rebellion in eastern Ukraine. The others attending tended to be Moscow's EU allies: Greece, Slovakia, Hungary and Cyprus. Zeman did, however, sit out Russia's military parade accompanying the event after a public uproar at home.

“On a personal level he feels that he has been ‘kind of expelled’ by the West because of his statements on Russia,” said Jakub Janda, the deputy director at the European Values think-tank in Prague.

“[The] Kremlin cares if Zeman undermines the West, which he is concretely doing,” Janda added in an email. “Putin will be glad to meet him in China.”

Zeman is expected to sign a number of agreements in China aimed at boosting bilateral trade and economic ties, according to Ovčáček. The president’s spokesman said that Zeman will not discuss human rights while in Beijing.

The government sets policy but the president has the power to throw sand in the gears of governance.

”The government doesn’t want to fight Zeman,” said Hospodářské noviny editor Jindřich Šídlo, “because there are other much more important issues, like upcoming ambassadorial appointments to China, the U.S. and Ukraine.”

Zeman's freelance foreign policy hasn't only upended the EU's efforts at setting a common approach on Russia and China. He has also annoyed the United States. Zeman banned the U.S. ambassador from Prague Castle after the diplomat said Zeman's earlier trip to Moscow would be "awkward."

Asked to confirm that Zeman had been rebuffed in his efforts to meet President Barack Obama in the White House, Ovčáček replied, “No comment.”