Baker made his first appearance in Doctor Who as Commander Maxil in the story Arc of Infinity (1983). Producer John Nathan-Turner described Baker's performance as being "quite arch" and a little sassy. Maxil was one of the few characters actually to shoot the Doctor, then played by Peter Davison.
At the time of Baker's casting as Davison's successor, he was the only actor portraying the Doctor to have appeared in the television series as another character prior to taking on the leading role (in 2013 Peter Capaldi was announced as the Twelfth Doctor after having previously appeared in another role in the 2008 episode "The Fires of Pompeii"). When Baker was cast to replace Davison, many fans cited that shooting scene in Arc of Infinity, prompting Baker to say jokingly that he got the part of the Doctor by killing the incumbent. Despite sharing a surname, he is no relation to Tom Baker, who previously played the Fourth Doctor in Doctor Who.
Baker's first appearance as the Doctor occurred at the final minutes of The Caves of Androzani, where he delivered his first few lines. The closing title sequence for episode four features Baker's face instead of Peter Davison and credits him as the Doctor before Davison's own credit. This was the first (and, to date, only) time that the new lead received top billing in the final story of an outgoing Doctor. Baker then made his first full story debut the following week in The Twin Dilemma. It was the first time since 1966, and only the second time in the series' history, that a new leading actor's debut story was shown before the conclusion of the previous lead's season.
Baker's era was interrupted by an 18-month hiatus which was announced in February 1985, midway through transmission of his first full season. The Controller of BBC1 at the time, Michael Grade, criticised Doctor Who, saying that the programme had become overly violent in 1985. Grade later admitted that he "hated" the series, which he described as a "very clunky studio show". One new Doctor Who story, Slipback, was produced for radio during the hiatus, which starred Baker and his regular television companion Nicola Bryant.
Doctor Who returned to television for its 23rd season in September 1986. The season featured a reduction in episodes, was made entirely on video for location scenes for the first time since 1975's The Sontaran Experiment and was produced as a 14-episode-long serial called The Trial of a Time Lord. This serial was a meta-textual reference to the fact that the series itself was "on trial" at this time. In 1986 Baker told an interviewer, "Tom Baker did it for seven years. ... There's a part of me which likes to have a tilt at records. I would like to think that maybe I'd still be doing it in eight years' time." However, later that year Michael Grade agreed to commission another series, on the condition that Baker was replaced. The BBC's Head of Series, Jonathan Powell, later said that the BBC was looking for "one last chance saloon, for an actor who would take off with the public."
He was removed from the part after starring in only eleven stories and just short of three years in the series, including the hiatus, making his tenure as the Doctor the shortest at that point. After his sacking, Baker refused to return to record a regeneration sequence. Instead, his replacement, Sylvester McCoy, played the fatally injured Sixth Doctor in a blonde wig as he regenerates in the opening minutes of Time and the Rani, his face hidden by video effects as the regeneration process occurs.
On 4 September 2011 at Riverside Studios, Hammersmith, London, Baker accepted the presidency of the Doctor Who Appreciation Society, which had previously been held by Jon Pertwee and Nicholas Courtney. Baker was elected following an online poll of the society's members where he won more votes than all the other candidates combined.