KABUL, Afghanistan — President Ashraf Ghani took a stage here last week and urged the crowd of young people before him not to join a huge exodus from Afghanistan, despite rising insecurity and economic hardship.

The gates of Western nations are closed on us, Mr. Ghani said. “Our dignity, our respect is in Afghanistan.”

To many Afghans, though, that rang hollow.

That is not only because Mr. Ghani’s path to power and prominence was paved abroad, as he lived and worked in the United States for much of his adult life. The addresses of the families of a majority of his government’s senior officials read like an atlas of world capitals, near and far — just not Kabul.

“How will they understand our pain?” said Mohamed Abas, 19, a roadside mechanic in Kabul, as he took a break from his lunch of fries and bread. Having entered Iran, Mr. Abas was turned back from the border with Turkey last month as he tried to make his way to Norway, where he had heard there were jobs.

“Their own children study, live and are having fun in Europe and America,” Mr. Abas said. “They cruise in their armored Lexus in front of us and they don’t even slow down — we eat their dirt. And if we complain, they smash us in the mouth.”

The reality of such a government, amid an exodus that seems only to be growing, has made it difficult for Afghanistan’s citizens to accept entreaties to stay home.

It has also created a dilemma for international donors, particularly the European countries where a majority of Afghan migrants are headed, despite those nations’ pouring of billions of dollars in aid over the past decade to stabilize Afghanistan. About 146,000 Afghans have arrived in Europe this year, the government says.

One question some European countries are grappling with: How can they confidently continue to invest in the stability of a country where top government officials lack the confidence to let their children live there? And another: How can they justify accepting the droves of migrants at their gates to their domestic constituencies after sending billions of dollars’ worth of aid to Afghanistan over the years?

“Obviously, not all the aid here was in vain; there has been a lot of progress,” said Markus Potzel, the German ambassador to Afghanistan, whose country has extended the presence of its 980 soldiers here for another year. “But we have to ask ourselves that question.”

Mr. Ghani’s two children live in the United States. The families of his vice presidents reside in Turkey and Iran. The family of Abdullah Abdullah, the country’s chief executive, is in India. The families of the top cabinet ministers, presidential advisers, deputy ministers and even some agency directors all live abroad.

A senior official close to Mr. Ghani acknowledged that “it would be symbolically helpful” if fewer officials in the government had families living abroad, but he said that it was the reality of a country that for decades has had one of the biggest refugee populations in the world.

“In a majority of developing countries, you find that an interesting number of high-ranking government officials are dual citizens,” the official said, speaking on condition of anonymity to avoid angering colleagues. “It’s not that it’s a best practice, but an acknowledgment of a sad reality.”

The saturation of the top ranks of the Afghan government with officials whose families live abroad has been a theme throughout the war.

In 2010, Gen. Stanley A. McChrystal, then the commander of United States and NATO forces in Afghanistan, raised the issue in an emotional meeting of President Hamid Karzai’s national security council as one reason he thought the war had lost focus and could not be won easily, according to notes of the meeting shared by one Afghan official at the meeting and confirmed by another.

“My father is 86, and he has a nephew fighting in Khost and another in Shindand,” General McChrystal said at the meeting. He added, “General Parker’s son lost his leg in Helmand,” referring to his British deputy, Gen. Nick Parker, whose son had two legs amputated after a roadside bombing. (In an email, General Parker said he had not been at the meeting himself but was later told about it by General McChrystal.)

General McChrystal then followed up with a question for the Afghan ministers at the table: “How many of you high-ranking Afghan officials have sons on the battleground?”

The silence was punctured by a senior security official making sure he had heard the question correctly through the translation on his headset.

Mr. Ghani’s government is under pressure from donor nations to take back Afghans they have deported, and previous agreements with those countries oblige him to do so, the official close to him said. But at the same time Mr. Ghani is working with the governments of countries like Germany, Sweden and Norway to create “pull factors” that might keep young people in Afghanistan. One of the ideas includes financial incentives for older civil servants to retire, which might free up as many as 30,000 government jobs for younger Afghans, according to some officials.

Germany has been the top destination for many Afghans, with nearly 80,000 arriving this year, according to Salahuddin Rabbani, the Afghan minister of foreign affairs. Mr. Potzel, the German ambassador, said that 43 percent of those whose cases had been reviewed had been given asylum.

“Normally, we would send the other 57 percent back, but in practice it is difficult,” Mr. Potzel said. “We have only sent back 7 this year.”

He added, “There won’t be planeloads we send back, but I can assure you next year it will be more than 7.”

The central issue in Germany’s screening of migrants is focusing on accepting those whose lives are in danger, and on turning back people considered “economic migrants.” Mr. Potzel said that decisions on asylum seekers would be made case by case.

But human rights activists say the indiscriminate nature of the violence in Afghanistan this year, where civilians have been targeted in areas once considered safe, leaves few options. The deportees would struggle to reintegrate, the activists say.

“The overall security situation in Afghanistan has worsened significantly this year — the Taliban and other insurgents have demonstrated that they can either take over or destabilize areas across most of Afghanistan,” said Ahmad Shuja, a research associate with Human Rights Watch. “On the other side of the equation, the government’s already limited capacity to help deportees is stretched thin by the increasing crisis of internal displacement.”

Germany’s focus is on dissuading more Afghans from leaving their country. The embassy has started an awareness campaign, following in the steps of Australia, with large billboards in major Afghan cities that try to curb rumors about easy, prosperous lives in Germany.

“Leaving Afghanistan — have you thought about this thoroughly?” one billboard reads.

The Afghan government has also begun campaigns highlighting the dangers migrants face on treacherous routes to Europe, including their falling prey to smugglers.

But such campaigns have so far had little success dissuading people from leaving.

Mr. Abas, the deported mechanic, said his smuggler had promised him “one roasted chicken per person for a meal” during the journey. All his group was given was a loaf of bread for each four people.

“I will never wish the journey on anyone,” Mr. Abas said. But he could not stay, either; business has been down, and he cannot make more than $3 a day. “I am trying to go again.”

Ahmad Shakib contributed reporting.

A version of this article appears in print on , on Page A4 of the New York edition with the headline: Pleas Ring Hollow as Afghan Leaders Try to Halt Exodus . Order Reprints | Today’s Paper | Subscribe