Wonder's move came as the worlds of sports, politics, and entertainment were reacting to President Donald Trump's comments denouncing protests by NFL players.
Attendees of the Global Citizens Festival gained access to the event through points earned by taking actions to eliminate poverty.
This year's lineup included Wonder, The Chainsmokers, the Lumineers, The Killers, and Green Day.
Prior to his performance, Wonder gave a speech to the crowd.
"What we do now is how we work toward a planet that can save and serve our lives and protect our future...Our global brothers and sisters, I didn't come here to preach, but I'm telling you, our spirits must be in the right place all the time, not just now, but whenever you need to interrupt hate, stand down bigotry, condemn sexism, and find love for all our global brothers and sisters every day. Tonight, I'm taking a knee for America. But not just one knee, I'm taking both knees. Both knees in prayer for our planet, our future, our leaders of the world, and our globe. Amen," Wonder said.
He was joined by his son Kwame.
(Stevie Wonder's appearance begins at 4:41:07)
During a rally in Alabama on Friday, President Trump said NFL players who kneel for the national anthem should be fired, and called on NFL Commissioner Roger Goodell to tell them to stand. Goodell and several team owners criticized the comments.
Later, Trump rescinded a White House invitation for NBA champion Stephen Curry.
The Warriors said it was clear they were not welcome at the White House.
Curry had said he did not want to go anyway, but the Warriors had not made a collective decision before Saturday - and had planned to discuss it in the morning before the president's tweet, to which coach Steve Kerr said : "Not surprised. He was going to break up with us before we could break up with him."
Bruce Maxwell, an African-American player for the Oakland Athletics, became the first major league baseball player to kneel during the national anthem. Teammate Mark Canha, who is white, put his right hand on one of Maxwell's shoulders during Saturday night's anthem. The Athletics released a statement saying they "respect and support all of our players' constitutional rights and freedom of expression."
The Associated Press contributed to this report.
Send a breaking news alert
Report a correction or typo
Learn more about the 6abc apps