He takes over from Caroline Wyatt, who is stepping down after being diagnosed with multiple sclerosis.
Bashir, who last worked for the BBC in 2004, is also known for TV interviews with suspects in the murder of Stephen Lawrence.
He said he "cannot wait to get started" in the role.
As correspondent, he will cover events and provide analysis on issues affecting different faiths both in the UK and around the world.
BBC head of newsgathering Jonathan Munro said: "Martin's track record in enterprising journalism is well known and respected in the industry and amongst our audiences.
"As a student of theology, Martin will bring immense knowledge of the brief to his new role, and an enthusiasm to cover the broadest range of faith-based stories."
Bashir said: "I am delighted to be rejoining the BBC at this time and in this subject area. The opportunity to cover the broad spectrum of religious affairs is challenging and compelling and I cannot wait to get started."
He first worked as a BBC news correspondent from 1987 to 1992, and then joined Panorama. He was there until 1999 and also presented BBC Radio 4's Sunday programme until 2004.
He worked for Tonight on ITV before moving to the US in 2004 to host ABC's Nightline programme. In 2010, he joined NBC News as an MSNBC anchor and a correspondent on NBC's Dateline programme.
He resigned from MSNBC in 2013 after making controversial remarks about former US vice-presidential candidate Sarah Palin.
It was during her 1995 interview with Bashir that Diana, Princess of Wales, admitted to having had an affair and also spoke of Prince Charles's relationship with the then Camilla Parker-Bowles.
"There were three of us in this marriage, so it was a bit crowded," she told Bashir on Panorama, in a programme watched by millions globally.
In 1999, he interviewed five men suspected of involvement in the murder of Stephen Lawrence.
In 2003 he also interviewed Michael Jackson for his controversial documentary, Living with Michael Jackson, which led to the pop star being charged with molesting one of the boys featured in the programme.
Jackson was later acquitted after being found not guilty of all charges, at the end of his four-month-long child abuse trial.
Follow us on Twitter @BBCNewsEnts, on Instagram, or if you have a story suggestion email entertainment.news@bbc.co.uk.

Massaro, 31, who took time out after suffering from fatigue in February, beat New Zealand's Joelle King 11-6 11-2 11-7 in Hull.
England's Nick Matthew is in the last four of the men's event.
The 34-year-old, seeking a fourth title, beat Frenchman Mathieu Castagnet 11-7 11-7 11-7.
Massaro will play defending champion and world number one Nicol David, after the Malaysian beat England's Sarah-Jane Perry 11-6 11-8 12-10.
Matthew's preparation had been interrupted by an ankle injury, but he was pleased with his performance which sets up a semi-final against world number one Mohamed Elshorbagy.
"I guess if you'd offered me a place in the semi-finals before the tournament I'm sure I would have taken it because it means I would have been feeling healthy," he said.
Colombia's Miguel Rodriguez plays Gregory Gaultier of France in the other men's semi-final, while in the women's competition, Camille Serme of France will meet Delia Arnold of Malaysia.

The 31-year-old has been out since February with a cruciate knee ligament injury but is close to full fitness.
After beginning his career at Tottenham he spent time on loan at Swindon, QPR, Gillingham and Norwich and joined Hull in 2006, before switching to the Clarets four years later.
"I'm over the moon to secure my future for the next couple of years," he said.
"I love it here. If it was for five years to stay here, then I would have signed that."
Journalist Martin Bashir, famous for his interviews with Princess Diana and Michael Jackson, is rejoining the BBC as its religious affairs correspondent.
[NEXT_CONCEPT]
England's former world champion Laura Massaro is through to the semi-finals of the British Open in her first tournament after a break from squash.
[NEXT_CONCEPT]
Burnley midfielder Dean Marney has signed a new two-year contract until 2017 with Championship side Burnley.