The Obamas deliver speeches during YouTube virtual ceremony

Former president Barack Obama said in a commencement speech Sunday that the nationwide protests following the recent deaths of unarmed black women and men including George Floyd were fueled from "decades worth of anguish, frustration, over unequal treatment and a failure to perform police practices."

Obama along with his wife, Michelle, delivered speeches during YouTube's "Dear Class of 2020" virtual ceremony. The duo, along with a wide-ranging, star-studded lineup including Beyoncé, Lady Gaga and Tom Brady, offered inspirational messages in hopes of uplifting new graduates.

The former president told graduates that the coronavirus shined a light on a plethora of America's ongoing issues.

"In a lot of ways, the pandemic just brought into focus problems that have been growing for a very long time," he continued. "Whether it's widening economic inequality, the lack of basic health care for millions of people, the continuing scourge of bigotry and sexism, or the division or dysfunction that plagued our political system."

Obama added: "As scary and uncertain these times may be, they are also a wake-up call. And they're an incredible opportunity for your generation."

Michelle Obama said the ongoing protests following Floyd's death are a "direct result of decades of unaddressed, prejudice and inequality." She said she understands those who are "scared or confused or angry, or just plain overwhelmed" with the events the past few months.

"Over these past couple of months, our foundation has been shaken," she said. "Not just by a pandemic that stole too many of our loved ones, upended our daily lives and sent tens of millions into unemployment, but also by the rumbling of the age-old fault lines that our country was built on, the lines of race and power that are now once again so nakedly exposed for all of us to grapple with."

Beyoncé delivered a stirring 10-minute speech to graduates. She spoke about the recent protests as well as shared her secrets to success and the importance of ownership.

"You are achieving things your parents and grandparents never could imagine for themselves," she said. "You are the answer to a generation of prayers."

Beyoncé advised graduates to believe in themselves as she did when the singer started her own company a decade ago. She said creating her own lane was challenging in an entertainment business that is still "very sexist" and "male-dominated." The singer also said the protests have already made an impact.

"Look what you've been able to do in the last 14 days," she said. "We've seen the power of the collective. We've seen what happens when we join for the same cause. Please, continue to be the voice for the voiceless."

The four-hour ceremony was filmed over the last several weeks, but Lady Gaga decided to re-record her message. Her initial speech touched on the effect COVID-19 had on this year's graduating class, but she wanted to speak more on the Floyd's death, the Black Lives Matter movement and racism in America.

"While my original commencement speech may not be directly relevant to what this country needs most right now, I wish to tell you today that though there is much to be sad about, there is also much to celebrated," she said. "You are watching what is a pivotal moment in this country's evolution. … Change will happen, and it will be for the better."

Taylor Swift said her high school graduation wasn't what she expected. The singer told a story about how she was on tour and unable to go to her own ceremony.

"I know this isn't the kind of graduation you thought you were going to be having," she said. "I ended up getting mailed my diploma. … It wasn't exactly what I had pictured."

Lizzo began the ceremony with a rousing performance. While wielding her flute, the "Truth Hurts" singer performed the classic "Pomp and Circumstance" before she congratulated graduates as the New York Philharmonic accompanied her.

Several music artists from Cynthia Erivo, Camila Cabello, Coldplay's Chris Martin, Ty Dolla $ign, Khalid and others collaborated to sing a rendition of U2's "Beautiful Day." Katy Perry led graduates in the ceremonial tassel turn at the end of the commencement celebration.