Rooney, anchoring a team that also included Rabah Yousif, Dwayne Cowan and Matthew Hudson-Smith, looked set to have to settle for bronze.
However, Bruno Hortelano of Spain hit the wall with 100m to go, allowing Belgium in to secure gold and GB silver.
Britain claim silver in thrilling 4x400m men's relay
Teenager Duplantis soars to record-breaking triumph in pole vault
The women's squad - Zoey Clarke, Anyika Onuora, Amy Allcock and Eilidh Doyle - came third behind Poland and France in their relay final shortly afterwards.
Justyna Swiety-Ersetic, having won gold in the individual event earlier, anchored the Polish team to gold in a time of 3:26.59.
Poland win 4x400m women's relay as GB take bronze
Earlier, Shara Proctor's 6.70 won bronze in the women's long jump, with Jazmin Sawyers finishing just outside the medals in fourth place.
Germany's Malaika Mihambo took gold with a jump of 6.75; while a season's best of 6.73 was enough for Maryna Bekh to claim the silver.
Elswehere, Dina Asher-Smith conclusively ended the reign of Dafne Schippers as Europe's sprint queen when she raced to victory in the 200 metres in the Olympic Stadium on Saturday to complete a magnificent European Championships double.
After consigning Schippers to bronze when winning the 100 metres easily on Tuesday, Britain's Asher-Smith offered an even more telling blow in the Dutchwoman's best event as she sped to victory in 21.89 seconds, the world's fastest time this year.
Silver medallist Schippers, twice a world champion over the half-lap, ran her fastest race of the summer but was still beaten by the huge margin of a quarter of a second in 22.14 seconds.
By successfully defending her 200m crown, the 22-year-old Asher-Smith joined some of the great names who have achieved the 100/200m European double at the same championships, like Schippers herself (2014) as well as Poland's Irena Szewinska (1974) and the 'flying Dutchwoman' Fanny Blankers-Koen (1950).
The history graduate made a slice of her own in quite dazzling fashion, racing out over the first 50 metres to leave Schippers trailing and then maintaining the gap over the last 75 metres where the Dutchwoman would normally thrive.
With additional reporting from Reuters
Asher-Smith completes treble on another golden night for GB in Berlin