Two 13-year-old Bayonne boys charged with burglary returned an XBox to their classmate and apologized after they were confronted, police say.

A 13-year-old Mechanic Street boy was working on a class project with two school buddies last week, and when they left his home, he noticed that his house keys were missing from his backpack, police reports said.

When the 13-year-old and his family returned from church at around 8 p.m. Sunday, they noticed that the front door was unlocked, two of the bedrooms had been somewhat ransacked, and an XBox video game system was missing, reports said.

The boy immediately suspected that his two friends had been involved and called the 25th Street and Prospect Avenue kids, who immediately admitted stealing the keys and the XBox, according to police.

While officers were at the Mechanic Street residence taking the boy’s report, one of the boys arrived with his mother to return the XBox, reports said.

Both of the so-called friends were charged with burglary, one was charged with two counts of theft for the keys and the gaming system, the other charged with only one count of theft, reports said.