Harry was William's best man at William's own glittering wedding to Kate Middleton in 2011 and has invited his sibling to repay the favour when he marries Markle at Windsor Castle in just over three weeks' time.
William was happy to be asked. "It feels great; thrilled and delighted obviously," he told reporters at the Greenhouse Centre, a facility that provides sport and social facilities for young people in London.
"Revenge is sweet, I'll be looking forward to this," he said, probably referring to the tradition for the best man to poke fun at the groom in a wedding speech.
Harry, accompanying his brother, said William had "known for months" he would have the role.
William, whose official title is the Duke of Cambridge, had no news on what name would be given to his new son, born on Monday.
"I'm working on that," he said in response to reporters' questions.
William and Kate's third child follows siblings George and Charlotte and pushes Harry down a place to sixth in line to the throne.
No political leaders are among the invitees. The guests will be people who have an existing direct relationship with the groom or the bride.
However, the couple have invited 1,200 members of the public into the grounds of Windsor Castle as part of the celebrations.
Names of bridesmaids and others in the wedding party have yet to be released.
Markle made her final TV appearance as an actress on Wednesday night, marrying long-time love interest Mike Ross in the U.S. legal drama "Suits".
(Except for the headline, this story has not been edited by NDTV staff and is published from a syndicated feed.)
Get the latest election news, live updates and election schedule for Lok Sabha Elections 2019 on ndtv.com/elections. Like us on Facebook or follow us on Twitter and Instagram for updates from each of the 543 parliamentary seats for the 2019 Indian general elections.