M. Ward performs Sunday evening at a sold out 9:30 Club. (Josh Sisk/The Washington Post)

After spending much of the past two years working on She & Him — a gentle folk-pop collaboration with Zooey Deschanel — M. Ward is in the mood to cleanse his palate.

At least that’s what it felt like at the 9:30 Club on Sunday night, where Ward tore through what amounted to a greatest-hits set, in addition to a handful of numbers from his new album. And since “A Wasteland Companion” is an uneven affair, surrounding songs such as “Clean Slate,” “I Get Ideas” and “Primitive Girl” with the strongest tunes from his rich back catalogue made for an entertaining, lively 90 minutes.

Ward played at rapid-fire pace in front of a backing band keyed by multi-instrumentalist Chris Scruggs, who added color via steel guitar (as on a stellar version of “Cosmopolitan Pap”) or bass and background vocals.

So from “Chinese Translation” to “Fishers of Men” to “Magic Trick” to covers of John Fahey, Daniel Johnston and Chuck Berry to a cheeky version of “Four Hours in Washington,” Ward played like an artist in complete control. And as engaging as the stroll through his verses and choruses was, the aggression with which he attacked his guitar solos was the night’s true highlight.

An opening set from Lee Ranaldo Band wasn’t short on six-string inspiration, either. Backed by a trio that included Sonic Youth compatriot Steve Shelly on drums, Ranaldo played the evening’s most searing guitar during a 40-minute set that brought to mind a Sonic Youth song title: “Tuff Gnarl.” The searing coda to “Xtina As I Knew Her,” alone, was well worth showing up early for.

Foster is a freelance writer.