Human remains found inside a car in Mexico have been identified as two kidnapped federal agents from the organized crime unit.

The Mexican attorney general's office said Sunday that the remains found last week were of Octavio Martinez and Alfonso Hernandez, who were last seen in an online video earlier this month tied up and surrounded by cartel members.

Martinez and Hernandez disappeared on February 5 after attending a family event in the Pacific state of Nayarit, one of the regions hit hardest by an increase in gang-related killings.

Octavio Martinez (left) and Alfonso Hernandez (right) disappeared on February 5 after attending a family event in Nayrit, Mexico

A video posted online the following weekend appeared to show the two agents kneeling and with their hands tied.

The description of the video on YouTube said the Jalisco New Generation Cartel was behind the kidnapping, but this could not be confirmed.

The attorney general's office said it returned the remains to the families of the agents after running DNA tests to confirm their identities, and would keep working to find the murderers.

A video was posted earlier this month showing the two on the ground tied up and surrounded by a group of gang members. Their bodies were then found in a car

'The Attorney General of the Republic laments and condemns this terrible finding, and expresses solidarity with the mourning of the families,' the office said in a statement.

Mexico is experiencing its worst-ever surge in violent crime, with more than 25,000 killings in 2017, a rate of nearly 21 per 100,000 people.

Mexican officials said last month the government would deploy more federal police troopers to crack down on criminal groups in affected regions. Violence has increased as rival drug gangs splinter into smaller groups and dispute territory.

The United States regards the cartel as one of Mexico's most powerful drug gangs.

Last year, Nayarit's then attorney general, Edgar Veytia, was arrested in San Diego on U.S. narcotics trafficking conspiracy charges.