SARAJEVO -- Turkish President Recep Tayyip Erdogan has called on his compatriots living in Europe "to show their strength to the whole world" as he sought to shore up support from the country’s diaspora at a rally in Sarajevo ahead of elections next month.

Thousands of Turkish citizens living abroad descended on the capital of Bosnia-Herzegovina on May 20 for a rally led by Erdogan amid tight security after several European Union countries banned such demonstrations on their soil.

An estimated 15,000 people attended the rally in the Sarajevo's Zetra sports center, where large portraits of Erdogan and Turkey's first president, Mustafa Kemal Ataturk, were put up a day earlier.

WATCH: Erdogan supporters from a number of EU countries arrived for his election campaign rally in Sarajevo on May 20.

During his speech, Erdogan pledged to work to provide job opportunities for Turkish citizens who retire abroad, as well as new programs for children to learn Turkish.

He also urged supporters to actively participate in European politics as a way to counter anti-Turkish sentiment.

"You need to be in those parliaments instead of the ones who betray our country," Erdogan said, referring to European lawmakers with Turkish roots.

Tensions rose last year between the EU and Turkey after many countries refused to allow the Turkish government to hold rallies ahead of a referendum, eventually won in Erdogan's favor, to widely expand the powers of the Turkish presidency.

There are some 3 million Turks in Europe eligible to vote in Turkish elections, with the most, some 1.4 million, in Germany.

Austria and the Netherlands last month said they would ban any campaigning by Turkish politicians in their countries for the June elections.

However, Sarajevo has close relations with Ankara, which has played a key role in the rebuilding of Bosnia after its near-destruction during the wars that broke out in the 1990s with the breakup of Yugoslavia.

Erdogan arrived on a working visit to Bosnia's capital earlier on May 20, accompanied by a large delegation that included the ministers of foreign affairs, economy, sports and youth, culture and tourism, and transport.

He met with the Muslim member of Bosnia's tripartite presidency, Bakir Izetbegovic, who attended the marriage of Erdogan's daughter in 2016.

After the meeting Erdogan said he would work to increase bilateral trade and pledged a multibillion-dollar investment in a key highway connecting Belgrade and Sarajevo.

"I believe that Turkish companies will build more infrastructure projects in Bosnia and I believe that the Belgrade-Sarajevo road project will be an example of a successful transport project," the Turkish president said.

Izetbegovic added that "Turkey supports our aspirations on the issue of the European Union and NATO memberships as well as on the issue of Bosnia-Herzegovina's economy."

Bosnia consists of two autonomous entities -- the Muslim-Croat Federation whose population is made up of Muslim Bosniaks and Catholic Croats, and Republika Srpska, where Orthodox Serbs are a majority.

About half of Bosnia's 3.5 million citizens are Muslims, one-third are Serbs, while about 15 percent are Croats.

Erdogan had no plans to meet the Serbian or Croatian members of the presidency.

Some in Bosnia expressed opposition to the Erdogan rally.

Bosnian Serb leader Milorad Dodik complained that the Turkish leader was "interfering a lot" in Bosnia's affairs.

Bosnia and much of the Balkans were ruled by the Ottomans for more than four centuries until 1878, and some critics referred to Erdogan’s action as "neo-Ottomanism."

With reporting by AFP, DW, and Ahval