The mayor of New York City has denied a report that he and his security detail illegally crossed the US-Mexican border on a recent visit, a spokesman says.

US Customs and Border Protection (CBP) alleged that Bill de Blasio crossed the border on foot near El Paso, Texas, the Associated Press reports.

Spokesman Eric Phillips rejected the claim that Mr de Blasio violated Mexican and US immigration laws.

Mr de Blasio had been visiting the US-Mexico border with 20 other mayors.

"The Mayor crossed the border with the direct approval and under the supervision of the border patrol supervisor at this port of entry," Mr Phillips said in a statement emailed to the BBC.

"Any suggestion otherwise is a flat out lie."

The accusations surrounding Mr de Blasio's border crossing come amidst continued controversy surrounding the nearly 3,000 children who have been split from undocumented adults entering the US under President Donald Trump's "zero tolerance" immigration policy.

Mr de Blasio was part of a bipartisan group of US mayors at the Texas border on 21 June, the day after President Trump signed an executive order to halt migrant family separations.

The mayor and his security team crossed the US-Mexican border to get a better view of a tent city holding separated migrant children, after being denied access on the US side.

CBP reportedly accused the mayor of breaking both US and Mexican immigration laws by crossing, according to a copy of a letter obtained by the Associated Press.

The letter, addressed to New York Police Department Commissioner James O'Neill, said a uniformed border official noticed the group taking photos of the holding facility from the Rio Grande River flood plain - south of the US point of entry in Tornillo, Texas.

The agent reportedly asked the group if anyone from Border Patrol was there to authorise the visit and asked how they had arrived.

A New York Police Department inspector with the group answered "no" and indicated that they had arrived from Mexico, according to the letter.

The official then reportedly informed the group they had crossed the border illegally.

Mr de Blasio, a Democrat, has been a fierce critic of the Trump administration's "zero tolerance" policy that has led to the migrant family separations.

He decried the "broken, inhumane policy" during an unscheduled visit on 20 June to a New York City facility allegedly housing separated migrant children.

"Our message to this federal government is simple: stop this right now."

The government had been bound by court order to reunite children aged five and under by 10 July, but US officials say that "legitimate, logistical impediments" are delaying reunions for many of the 102 children under five years old.

The US government must also work to meet a court order that demands the remaining 2,000 or so children be reunited with their families by 26 July.