Beyoncé Knowles has donated a track to World Humanitarian Day.

The superstar, along with songwriter Diane Warren, wanted to inspire people around the globe to do something for others by working with the United Nations. They decided to give the song I Was Here from Beyoncé’s smash hit album 4 to the good cause.

“We all see the headlines and we think what can I really do to help?” Beyoncé said. “World Humanitarian Day is an opportunity for all of us to work together to make a difference. This is our time to leave our mark on the world and show that we were here and we care.”

Beyoncé also stars in a special video for the song which was filmed at the United Nations General Assembly Hall in New York City.

The promo will be released on August 19 and the campaign aims to reach one billion people in a day with its message.

Meanwhile, the 30-year-old star has been enjoying watching the Olympic Games. Beyoncé took to her Twitter account to congratulate US gymnast Gabby Douglas for triumphing in the women’s all-round final.

"A huge congratulations to 16 year old Olympic Gold Medalist Gabby Douglas - WOW - what a thrill to watch you take this Gold! - enjoy this moment, its yours. Thank you for inspiring all of us! Love, B (sic)."

Beyoncé hasn’t been the only famous face paying tribute to Gabby – who is the first African American woman to take home the title.

Oprah Winfrey, President Barack Obama, Octavia Spencer, Nicki Minaj, Elizabeth Banks and Estelle have also been singing her praises.

"OMG I'm so thrilled for Gabby," Oprah tweeted on Thursday. "Flowing happy tears!"