Los Angeles Mayor Eric Garcetti sent out mixed messages about his endorsement for Hillary Clinton for president on Thursday.

After the mayor's office issued a statement endorsing the Democratic front-runner, he quickly retracted the statement, only to reissue an endorsement from another account.

In the initial statement, the L.A. mayor said the former secretary of state "understands the challenges and opportunities facing the nation's cities and will be a powerful leader in building our future. In Hillary Clinton, Mayors will have a partner, someone ready to stand up for our mainstream economy," Garcetti wrote, according to Politico.

About an hour later, the mayor's office issued a notice saying the endorsement statement was sent accidentally, reports The San Francisco Chronicle.

"Today's statement on Hillary Clinton was sent in error," the second press release said.

Shortly after that notice, a new statement was issued by Garcetti's re-election campaign reiterating the initial endorsement.

It turns out that the original statement was sent out illegally since California law bans government resources and equipment from being used for election purposes. That's why the first endorsement had to be retracted and replaced by one from the 2017 campaign.

"Both city and state law prohibit the use of government staff time and equipment for campaign news releases, including endorsements," wrote the Los Angeles Times.

Garcetti's staff told The Times that the original press release was sent from the wrong email account.

"It was supposed to go out from me and someone in the (mayor's) office inadvertently sent it out from the -- I don't really know what the explanation is," said Bill Carrick, who works for Garcetti's 2017 re-election campaign, about why it was sent from a government email account.

Last month, Clinton scored a major endorsement from U.S. Secretary of Housing and Urban Development Secretary Julian Castro.