SEOUL, South Korea — North Korea said Friday that it would repatriate a South Korean fishing boat it detained for crossing the eastern sea border, a rare humanitarian gesture at a time of military tensions on the Korean Peninsula.

The South Korean boat, 391 Hungjin, was captured at dawn on Saturday when it illegally crossed the maritime border, known as the Northern Limit Line, off the eastern coast of the Korean Peninsula, the North’s official Korean Central News Agency said Friday.

The boat deliberately intruded into North Korean waters for fishing, the news agency said.

But it said North Korea “decided to repatriate the boat and its crew from the humanitarian point of view, taking into account the fact that all the crewmen honestly admitted their offense, repeatedly apologizing and asking for leniency.”

The North said it would release the ship at the maritime border on Friday evening, without saying how many crew members were on board.