El Salvador's President posted the photo on Twitter to his 1.1 million followers.

El Salvador's President Nayib Bukele, whose social media savvy helped win him power earlier this year, took a selfie before his maiden speech at the UN General Assembly, which he called "obsolete" and suggested scrapping.

In a dark suit and no tie, his hair slicked back in his signature style, the 38-year-old thanked the other leaders present and said he especially wanted to greet his wife and baby daughter sitting in the gallery.

"If you'll just bear with me a second," he then added, pulling out his iPhone 11, lifting it up to his grinning face and snapping a photo he later posted on Twitter to his 1.1 million followers.

"Believe me, many more people will see that selfie when I share it than will listen to this speech -- I hope I took a good one."

"A couple of images on Instagram can have more impact than any speech delivered in this assembly," he said, quipping that the annual summit of the world's leaders could be done by video-conference.

The conservative businessman and former mayor of the capital San Salvador was sworn into office in June in the small Central American country of 6.6 million people, tasked with turning around grinding poverty and rampant gang violence that are sending thousands fleeing to the United States.

He traded on his telegenic looks and promises of a break with the past, but critics have called him light on policy and substance.

Trump bromance

On Wednesday, he held his first meeting with US President Donald Trump, a fellow prolific social media user and self-styled iconoclast whom Bukele has aggressively courted -- a contrast with his predecessor Salvador Sanchez Ceren, a leftist former guerrilla.

The two countries reached an agreement last week to curb illegal migration that opens the door for the United States to send refugees back to the violent Central American country, a move slammed by migrant rights advocates.

"For us, the United States is not only a partner and an ally, but also a friend," Bukele told reporters after that meeting.

"We're hoping that this meeting will only strengthen our relationship even more, and I think it will because, you know, President Trump is very nice and cool, and I'm nice and cool, too. We both use Twitter a lot, so, you know, we'll get along."

Talking to journalists on Thursday after his speech, he defended his show of bonhomie with the US leader.

"Someone made fun of the fact that I joked with Trump. Did they want me to come fight with him -- or for me put on a cranky face or something?"

On the controversial migration agreement, he appeared to agree that those Salvadorans fleeing to the US were involved in gangs.

"We've supported our natural and biggest ally," he said. "We've caught human traffickers, we've seized their money, their arms, false documents."

"El Salvador has to propose a positive migration, academic migration, business migration, work migration, not those with false documents or drugs."