The government said the "terrorist, vile, barbaric act" targeted civilians and killed "12 children, including five less than five years old; three women including two who are pregnant; and five men including a policeman who came to help the civilians".
Nine other people were wounded and have been hospitalised.
RED-Tabara, Burundi's main rebel group, said in a message on X, formerly Twitter, that "fighters... based in Burundi attacked the Vugizo border post" and that "nine military and one policeman were killed".
Two military and security sources told AFP that the attack targeted "a military position".
"The civilians were caught in the crossfire and were killed, and then the assailants retreated to DRC," a senior military official told AFP on condition of anonymity, confirming the toll of 20.
The attack marked the second one in two weeks inside Burundi by the rebels, who have not been active since September 2021, when they carried out a series of attacks, including on the Bujumbura airport.