NEW DELHI — India’s top investigative agency said Thursday that two teenage girls believed to have been raped and hanged by attackers in a north Indian village actually committed suicide because of shame over a relationship with a boyfriend.

An earlier probe by local police and post-mortem reports were incorrect, and five innocent men were arrested, said Kanchan Prasad, spokeswoman for the Central Bureau of Investigation.

Six months ago, images of the girls’ bodies hanging from a tree in their village of Katra in Uttar Pradesh state shocked the country, long inured to violence against women.

Local police said the girls were gang-raped and murdered. The five men were arrested and later released on bail.

The federal agency took over the probe following public outrage over the deaths of the two cousins, who were about 14 years of age. They were the daughters of two brothers.

“The CBI has come to the conclusion that the allegations of sexual assault and murder were false. It was a case of suicide,” Prasad said.

She said medical reports ruled out any sexual assault, and the parents of the girls had filed a false police report of rape and murder.

“There were no marks of violence or injuries on the bodies of the two girls, except for the ligature marks on their necks. Also, nobody heard any cries for help though there were houses around the spot where the bodies were found hanging,” she said.

Prasad said the older of the girls had a relationship with one of the suspects which she hid from her family.

The night the girls died, the younger girl had called her cousin’s boyfriend and suggested they go to a local fair. The three left their homes after dinner, Prasad said.

Later, the older girl and her boyfriend were caught by one of her relatives as they were about to have sex in a nearby field, she said.

The girls apparently committed suicide because they were afraid of the reaction of their families and the stigma attached to what they had done, the spokeswoman said. Indian villages are extremely conservative and such a scandal would be difficult for a family to bear.

The CBI will hand over its findings to a court, which will decide whether to prosecute the families of the girls for filing a false police complaint, she said.