He said he was "very flattered to be asked back" and was "currently dusting off my dancing shoes".
The programme's boss Simon Cowell said: "Dermot's back, hooray! And so is his dancing! Welcome home, Dermot."
Dermot left The X Factor after "eight wonderful years" and was replaced by Olly Murs and Caroline Flack.
Dermot said: "There is nothing more exciting than hosting live TV on a Saturday night. The show is naturally very close to my heart, after having hosted it for eight years.
"I'm excited to be back."
Olly and Caroline announced they were leaving the show in February after just one series, less than a week after Radio 1 DJ Nick Grimshaw said he would not be returning as a judge.
The audience figures for The X Factor have been falling over the last few years, and more people in the UK regularly chose to watch the BBC's Strictly Come Dancing on a Saturday night in 2015.
The show is also seeing the return of the room auditions, in which hopefuls sing for the judges face-to-face in a more intimate setting. If they impress three or more of the judges, they move on to the next stage of the competition.
The X Factor has made a number of singers into stars, including One Direction, who finished third in 2010 and have sold more than 70 million records worldwide.
Former contestant Olly has had four big-selling albums and 2011 champs Little Mix - the first group to win - have sold 3.3 million albums globally.
The revamped show will return this autumn.
Dermot O'Leary has said he is "really looking forward" to returning to The X Factor as its presenter - just a year after he left the ITV talent show.