MEXICO CITY — Heavily armed gunmen shot and wounded Mexico City's police chief Friday in a brazen attack that left three people dead, including an innocent bystander, in one of the nation's wealthiest enclaves.

Security Secretary Omar Garcia Harfuch, who was being treated in a hospital after being struck by three bullets, tweeted that the Jalisco New Generation cartel, one of Mexico's most powerful criminal groups, was responsible for the ambush.

Garcia was traveling in an SUV with his security detail at 6:30 a.m. when a large construction truck carrying gunmen armed with rifles and grenades blocked its path and opened fire, Mexico City Mayor Claudia Sheinbaum said.

Two of those killed worked for Garcia. The third victim who died was a woman who happened to be driving nearby.

Mexico City Attorney General Ernestina Godoy Ramos said that 12 people had been arrested in connection with the attack that took place on Paseo de la Reforma, Mexico City's principal avenue. The section of the roadway where it occurred is in a tony neighborhood that is home to some of the nation's wealthiest residents as well as the United States ambassador.

Bold assassination attempts on public figures have been a dominant feature of Mexico's longstanding battle with organized crime. In the Pacific Coast state of Colima this month, for example, gunmen stormed the home of a federal judge who had tried organized crime cases and killed him and his wife.

But few such attacks have taken place in Mexico City. Many worried that Friday's shooting signaled a worrying advance of organized crime on the nation's capital.

Homicides are on the rise nationwide, with 2020 on track to be the most violent year on record since Mexico began publishing crime statistics in 1997. Crime has been rising in the capital, although city authorities have repeatedly said that the nation's largest and most brutal criminal organizations, including the Jalisco cartel and its rival the Sinaloa cartel, do not have a major presence here.

Speaking at his daily news conference President Andres Manuel Lopez Obrador suggested the attack was actually evidence that security officials were making inroads in their fight against crime.

The attack, the president said, "without a doubt has to do with the work (Garcia) is carrying out to guarantee peace and tranquility."

Garcia tweeted about the incident from the hospital where he was being treated.

"This morning we were attacked in a cowardly way by the CJNG," he said, using the Spanish-language acronym for the Jalisco cartel.

"Two colleagues and friends of mine lost their lives," he said. "I have three bullet wounds and various pieces of shrapnel. Our nation has to continue standing up to cowardly organized crime. We will continue working."