See Pharrell Battle Jimmy Fallon in Song-Naming Challenge

The Roots played famous tracks from Oasis and Snoop Dogg as Williams and Fallon scrambled to identify them

Pharrell Williams and Jimmy Fallon competed in the "Name That Song Challenge" on 'The Tonight Show.'

Pharrell Williams squared off against Jimmy Fallon in a musical battle of wits on The Tonight Show on Monday.

Their "Name That Song Challenge" followed straightforward rules. The Roots pick a tune – this set was heavy on 1980s radio hits – and play it one instrument at a time, usually leading with a synthesizer line. The contestants are equipped with buzzers; whoever rings first gets to name the track.

Fallon dominated the first half of the game, quickly identifying A-Ha's "Take on Me" and Toto's "Africa." He chortled with glee after he named a song correctly and brought a slightly manic intensity to the contest – especially in contrast with Williams, who initially seemed cool and somewhat detached from the proceedings.

But Williams was apparently biding his time: After falling behind, he pulled even by beating Fallon to the buzzer when the Roots played Johnny Kemp's "Just Got Paid" and celebrated with his own amusing victory dance. Williams won the best-of-seven series a moment later by identifying "Drop It Like It's Hot" – a Number One hit that he helped produce for Snoop Dogg.

Williams was visiting The Tonight Show to promote the movie Despicable Me 3, out Friday. The soundtrack to the film includes five new songs from Williams. He has also been busy with other projects, appearing as a featured vocalist on Calvin Harris' new song "Feels" and plotting a musical film based on his own childhood