Cavic, who collected a silver medal in the 50 freestyle final, clocked 50.02 seconds to beat the 100 butterfly world mark of 50.10 set by Germany's Thomas Rupprath in 2002.
Cavic seized control at the start and touched at the halfway mark more than half a second clear of Rupprath.
The German, winner of the event at the last three editions of the championships, battled in vain to catch him and lost his world record as well as the title as Cavic hit the wall well clear. Rupprath took the silver in 50.43 and world long-course bronze medallist Andriy Serdinov of Ukraine the bronze in 50.88.
"I love competing in international championships with the Serbian team," said the 19-year-old Cavic.
It was a hectic evening for Rupprath, who was back 24 minutes later to retain his 50 metres backstroke crown in his third swim of the session.
"The 50 back final was not good but I did enough to win. I felt much better in the semis. On the other hand I'm quite happy with my performance in the 100 fly," the 26-year-old German said.
Rupprath managed only 23.71 in the final but won comfortably from Vyacheslav Shyrshov of Ukraine and fellow German Toni Helbig.
Antje Buschschulte retained her 100 backstroke title in 58.40, so Germany led the medals table with four golds at the halfway point of the championships.
Eighteen-year-old Hungarian Laszlo Cseh gave further evidence of his talent when he broke the European short-course 400 metres individual medley record, while Britain's James Gibson dominated the 100 breaststroke to win in a championship record 58.03 from defending champion Oleg Lisogor of Ukraine and fellow Briton Darren Mew.
Malia Metella scored a surprise victory for France in the women's 100 metres freestyle and Erika Villaecija brought Spain their first gold of the championships with an unexpected and clearcut victory in the 800 metres freestyle.
The Netherlands twice set world best times for the rarely swum women's 4x50 metres freestyle relay.
Hinkelien Schreuder, Annabel Kosten, Chantal Groot and Marleen Veldhuis clocked 1:38.13 in the heats to beat the 1:38.21 set by Sweden in December 2000, then lowered it to 1:37.52 when they won the final.