Miley Cyrus appeared as her "Black Mirror" character Ashley O at Glastonbury as she credited the festival with changing her life in an expletive-laden speech during her set.

The star, 26, took to the Pyramid Stage at the festival on Sunday evening and dressed up as fictional pop star Ashley from "Black Mirror."

Miley performed "On A Roll" from the Netflix show in Ashley's costume before changing back into her leather performance outfit and giving an X-rated speech to fans.

NICKI MINAJ SLAMMED MILEY CYRUS ON RADIO SHOW: 'SHE DISRESPECTED ME'

She told the crowd: "I just want to let you know in many ways this show has changed my f---ing life drastically.

"A lot of hard work, a lot of dedication and a lot of sacrifice.

"Both of my parents, who are side-stage right now, have taught me that that's the only way anything is going to happen for you."

GLASTONBURY, ENGLAND - JUNE 30: Miley Cyrus performs on The Pyramid Stage during day five of Glastonbury Festival at Worthy Farm, Pilton on June 30, 2019 in Glastonbury, England.  (Photo by Harry Durrant/Getty Images)

She went on: "My dad had an amazing analogy for me.

"He said go sit on a bicycle and go to the very top of the hill and watch how fast you go downhill and it's going to be easy.

"Now do the same thing, sit on that bicycle and go uphill - it's not going to do it for you.

"You are going to have to work your f---ing a-- off and you are going to feel it the next f---ing day, but it's going to be worth it because you did something.

Miley Cyrus performs on the Pyramid Stage during day five of Glastonbury Festival at Worthy Farm, Pilton on June 30, 2019 in Glastonbury, England. (Photo by Samir Hussein/WireImage)

MILEY CYRUS BLAMES 'PRIVILEGE' IN APOLOGY FOR PAST COMMENTS ABOUT HIP-HOP: 'MY WORDS BECAME A DIVIDER'

"You did something that you thought you couldn't do. And that is what I'm doing."

Cyrus - who was clad in tight black pants and a cropped white top with a belt spelling out the word "Glastonbury" in studs - continued: "I was watching The Killers from at home last night, which they f---ing rocked so it scared the s--- out of me.

"I ask the universe every day, 'Give me something that scares the f--- out of me and then I'm going to f---ing do it', so today that is motherf---ing Glastonbury."

GLASTONBURY, ENGLAND - JUNE 30: Miley Cyrus performs on The Pyramid Stage during day five of Glastonbury Festival at Worthy Farm, Pilton on June 30, 2019 in Glastonbury, England. (Photo by Harry Durrant/Getty Images)

The singer kicked off her set with a performance of "Nothing Breaks Like A Heart" and "Back To Black" with Mark Ronson, and was later joined by Lil Nas X and her dad Billy Ray Cyrus for a performance of "Old Town Road."

CLICK HERE TO GET THE FOX NEWS APP

Other tracks during Cyrus's show included "Jolene," "Party In The USA," "Mother's Daughter" and "Wrecking Ball."

This article originally appeared in The Sun.