A stunning free-kick from Brandon Forbes settled an entertaining Premier Sports Cup match at Tannadice as Dundee United edged out battling Ayr United.
The 18-year-old substitute had only been on the pitch for four minutes as he hammered a shot from 25 yards into the top corner of the net.
David Babunski had given United a 17th-minute lead with another free-kick, his delivery from a tight angle sneaking in at the back post.
The impressive Marco Rus had levelled for the Championship side after the interval with a composed finish following a run from near halfway.