The officers said they felt sorry for the migrants, who were found in a lorry in Belgium, and offered to give them a lift to the border.
But they strayed into France, where they were arrested and questioned.
The incident sparked a diplomatic spat, with France's interior minister summoning the Belgian ambassador.
Bernard Cazeneuve had a "frank and clear" meeting with the Belgian ambassador, according to French officials, and expressed his disquiet at what had happened.
France strongly condemned the officers' action which "does not conform to the normal work practices agreed between France and Belgium".
But there was surprise at the French reaction from Georges Aeck, the Ypres police commissioner, because of the two countries' usual close border co-operation.
"We didn't do it for money, this isn't human trafficking," he told Belgian broadcaster RTBF. "We only gave them a hand. We took them a little way in the direction they wanted to go,"
The bizarre chain of events began on Tuesday evening, when French police in an unmarked car stopped the Belgian police van carrying the 13 migrants, including three minors, on the French side of the border in Nieppe, north-west of Lille.
The migrants had been discovered earlier in the day and ordered to leave the country.
But when the officers spotted them walking on foot towards the border, they offered them a lift and accidentally strayed into France near Nieppe.
The two officers were handcuffed, despite identifying themselves, the Belgian police union said.
Vincent Gilles, the president of the Belgian police union, complained that the officers had been treated like "criminal suspects" and held for four hours without access to a lawyer.
Mr Aeck added: "It's the first time this has happened because we have a good relationship with our French colleagues. We sometimes organise the control system together on the border. We are a little surprised.
"The Belgian officers took the migrants in their van because they didn't want to let them go on foot directly along the road to the border. They escorted the migrants as far as the border, in the direction they wanted to go."
The migrants themselves were then taken to a police station in the French city of Lille, where three minors were placed in the care of local authorities and the adults temporarily detained to assess their status.
Temporary border controls were brought in by Belgium for a few months earlier this year, amid concerns the proposed demolition of the Calais "Jungle" camp would send an influx of migrants north.
Calais is less than an hour's drive from the Belgian border.

5 May 2016 Last updated at 08:32 BST
The cops even threw in some Scottish country dancing to add their own twist.
The Scottish force has now challenged police in London and Toronto, Canada, to get their groove on too.
The viral craze sees people recording themselves dancing to My Boo by Ghost Town DJs, posting the video on social media and then challenging others to join in.
Two Belgian policemen have been questioned by their French counterparts after they were caught with 13 illegal immigrants in their car.
[NEXT_CONCEPT]
Police officers in Scotland's capital city, Edinburgh, have taken on the Running Man Challenge.