He has battled an insane half-human, half-flesh mutant called Jennifer, crash-landed in Nazi Germany and met up with his old foes the Cybermen in the series so far.

But on Saturday night the Doctor will take time off from saving the Earth – and himself – to pay tribute to one of the show's most popular actors, Nicholas Courtney, who died this year after playing the Doctor's companion, Brigadier Alistair Lethbridge-Stewart, over a period of more than 40 years.

In The Wedding of River Song, the 13th and final episode of the current series, the Doctor – played by Matt Smith – learns of the death of his former colleague in a phone call from the nursing home where the fictional brigadier spent his last days.

"I'm afraid Brigadier Lethbridge-Stewart passed away a few months ago," the nurse tells the Doctor. "It was very peaceful. Talked a lot about you, if that's any comfort. Always made us pour an extra brandy in case you came round one of these days."

The Doctor takes a few moments to compose himself as his mind turns towards his own fate – a climax that promises to reveal the identity of the astronaut seen shooting the Doctor in episode one of the series.

Doctor Who's executive producer, Steven Moffat, said of the decision to include the tribute to Courtney's character: "In a story about the Doctor going to his death, it seemed right and proper to acknowledge one of the greatest losses Doctor Who has endured."

Courtney made his first Doctor Who appearance in 1965 opposite William Hartnell, as the doomed space security agent Bret Vyon, but returned three years later to play Lethbridge-Stewart, when the Doctor was played by Patrick Troughton.

In a memorable moment in the 1971 story The Daemons he spots a murderous gargoyle figure and instructs a subordinate: "Jenkins – chap with wings there, five rounds rapid!"

Courtney made regular appearances alongside subsequent Doctors Jon Pertwee, Tom Baker, Peter Davison and Sylvester McCoy until 1989, when the show was cancelled by the BBC.

After its revival in 2005, viewers were told his character was in Peru until he was revived again for The Sarah Jane Adventures, a Doctor Who spinoff for the CBBC children's channel in 2008.

Courtney died after a long illness at the age of 81. Elisabeth Sladen, who played Sarah Jane Smith, died in April. The final series of her Sarah Jane Adventures begins on Monday on CBBC.

The BBC will be hoping that Saturday's finale boosts the viewing figures for the main series, which so far has performed well. According to the consolidated overnight ratings, this series is averaging 7.6 million viewers an episode, up on last year's average of 7.3 million.

There has been a generally good critical reaction to the series, the sixth since Doctor Who returned in 2005 and which ran for seven episodes with a mid-season finale before a run of six.

The Guardian's Doctor Who expert, Dan Martin, said that episode 10, The Girl Who Waited, was "a damn near-perfect episode".

Smith has signed up for a third series and Christmas special, and there has been speculation that he will appear in a fourth series in 2013, marking the 50th anniversary.