Former President Barack Obama has doled out what may be his first major political endorsement since stepping down from office, and it’s for Los Angeles Mayor Eric Garcetti.

“I strongly endorse Eric Garcetti for a second term as mayor of Los Angeles,” Obama said in a written statement released Tuesday by the mayor’s re-election campaign.

Referring to Garcetti as “my friend, a loyal ally and a great and visionary mayor of Los Angeles,” Obama credited the mayor with “raising the minimum wage, creating jobs and expanding economic opportunity,” as well as successfully campaigning for Measure M, a sales tax measure in November to pay for public transportation projects.

Garcetti previously courted but failed to secure Obama’s support during a heated race against former City Controller Wendy Greuel in 2013, though he received support from an Obama surrogate, former presidential adviser David Axelrod.

This time around, Garcetti is not expected to face as fierce of a fight. The closest challenger, political strategist Mitchell Schwartz, has mounted a spirited campaign but trails Garcetti’s $3 million war chest with just over $360,000 raised a month out from the primary.

• RELATED STORY: LA mayoral candidate Mitchell Schwartz issues 3-point plan to reform the DWP

Garcetti, who campaigned for Obama during his first run for president in 2008, said he was “honored and humbled” by the show of support. He pointed to their long-running relationship, in which the two collaborated on efforts to “create jobs, build infrastructure and lift people from poverty all across our city.”

Garcetti has been a frequent visitor to Washington, D.C., during his current term, often stating that he was traveling across the country in order to speak to the Obama administration officials about securing federal funding for local transportation projects, homelessness programs and other needs.

During an event at his Windsor Square campaign headquarters, Garcetti said the White House would often “reach out to us for examples that they could take nationwide.”

“There was hardly a month that went by” when the White House would call his office to ask about Los Angeles’ approach to such issues as jobs, infrastructure, education, policing and poverty.

The relationship went both ways, and “we would be invited to participate” in White House initiatives, he said.

While he said he would miss this working relationship, now that a new president is in office, he won’t “close that door in any administration.”

“We’re always going to work hard no matter who the president is, to have that access to return our tax dollars to Los Angeles, and to have partners on things like our infrastructure initiative and transportation.”

He added he will “miss (Obama’s) friendship and … that he mentored me.”

Garcetti shared an anecdote suggesting that Obama influenced a decision to give up a role in the White House in favor of running for the mayor’s seat, the first time around.

Garcetti said he visited Obama in the Oval Office “a few years ago, before I decided to run for mayor.” The conversation had been meant to “encourage me to take a job heading up urban policy in the White House,” he said.

“And he (Obama) gave me great advice that day,” noting that he had heard of his aspirations to run for mayor, Garcetti said.

Garcetti said he responded that he felt the White House job was “an amazing opportunity,” but Obama told him to “listen to your heart” and to try for the mayor’s seat if he felt he could win and “this is where you need to be.”

“To the great disappointment of his staff, who figured by inviting me to the Oval Office that it would be a done deal, I called him up later and said to him, ‘You’re a really bad salesman Mr. President, but a great friend, and I’m going to run for mayor.”

Schwartz, who ran Obama’s California campaign in 2008, said he was not surprised by the endorsement of his opponent.

“I wish I got it,” Schwartz said, adding with some nonchalance, “what can I say? I didn’t get it.”

Schwartz said that he has not been “in touch” with the Obama administration over the years, and he did not seek an endorsement from the former president.

Schwartz has repeatedly called on Garcetti — widely thought to be contemplating a run for governor in 2018 — to commit to staying through his term, if re-elected.