He will round off a UK tour of outdoor shows with a announced a July date at the castle esplanade months after revealing that he planned to walk away from “rock ‘n’ roll touring” after this year.
Sir Rod will be making his first appearance the castle for 13 years when he appears on Thursday, July 6.
He has been added to the line-up of Regular Music’s annual Castle Concerts, which already features a gig by The Lumineers and two shows by The Who – the band’s first appearances in Edinburgh for more than 40 years.
The Edinburgh show, tickets for which go on sale on Friday, is the only Scottish date on Sir Rod’s UK tour, which also includes outdoors gigs in Plymouth, Northampton, Durham, Bristol and Hull.
Sir Rod, who also played Edinburgh Castle in 2002, has strong connections with the city as his father Robert was a plumber from Leith.
Speaking about the newly-announced dates, Sir Rod said: “My favourite memories have been summer nights with a beer or two alongside the best fans in the world.
“I'm impatiently awaiting this summer playing at a variety of special venues – football, cricket and rugby stadiums, estates and castles. We'll all be dancing under the stars.”
Sir Rod, who was presented with an outstanding achievement honour at the Scottish Music Awards in November, has already confirmed live dates in Australia, New Zealand, the United States, Mexico, Canada and Spain this year.
However, speaking in the run-up to arena shows in Glasgow and Aberdeen last year, Sir Rod stunned fans when he said he would be retiring classic anthems like Maggie May and Hot Legs.
He said at the time: “Next year will be the end of my rock ‘n’ roll touring. I want to do something different.
"It feels like an end of an era. All things must come to an end.
"I’m not retiring and I still love singing, I just want to do something new.
"I might do a few folk clubs playing guitar.
"I don’t want to do the big tours any more, especially in America. It takes me away from my kids for so long.
“It used to be OK because it was fun and games. It is still fun and games, but I miss my kids so much.”
Edinburgh is gearing up for one of its busiest summers of live music in modern times.
As well as the Castle Concerts, Regular Music is also staging two headline shows by The Proclaimers on Leith Links in June.
Murrayfield is lined up to host four huge outdoor concerts in May – Beyoncé, Bruce Springsteen and two Harry Styles shows.
The Royal Highland Centre will be hosting several large-scale outdoor gigs after playing host to the Connect music festival for the second year in a row.
The Killers and Johnny Marr will be appearing on August 29 while Lewis Capaldi and McFly will be playing back-to-back shows on August 30 and September 1.
Capaldi recently concluded his UK area tour, after releasing his comeback single ‘Forget Me’ last year, which soared straight to the top of the UK singles chart. He is set to release his much-anticipated second album, ‘Broken By Desire To Be Heavenly Sent’, in May.