Singer and actress Cher headlined Sydney's 40th annual Gay and Lesbian Mardi Gras after-party on Saturday.

The 71-year-old pop and gay icon performed a 4-song set before a jubilant audience. Cher performed All or Nothing, Believe and Strong Enough before leaving the stage to change into an outfit similar to the one she wore in the video for her 1989 smash hit If I Could Turn Back Time, complete with curly black wig and skimpy leotard.

Cher also made an impromptu appearance during the parade, surprising parade-goers on Taylor Square to the tune of Turn Back Time.

It was the first parade since Australia legalized same-sex marriage in 2017.

β€œIt's about time,” Cher said of the marriage law.

(Related: First gay couples wed in Australia.)

β€œI love that everybody is having such a good time and there's no feeling of any kind of anger, there's no negativity and that's what I like most,” she added.

About 300,000 spectators watched as the parade wound its way down Sydney's Oxford Street.