The BBC says it will make sure there isn't another on-screen ad during the closing seconds of Doctor Who, after thousands of fans complained.
An animated version of TV host Graham Norton popped up during the end of Saturday's episode, almost covering Matt Smith's mouth as he spoke.
Around 5,600 viewers complained about the ad, saying it spoiled the drama of the cliff-hanger ending.
The BBC has now said the trailer should not have been shown.
It appeared just seconds before a cliff-hanger ending as The Doctor's pals were being pursued by the spooky weeping angels.
The BBC said: "The Over the Rainbow trail in Doctor Who should not have played out on Saturday and we apologise to all Doctor Who fans whose enjoyment of the show was disrupted.
"We recognise the strength of feeling that has been expressed and are taking steps to ensure that this mistake will not happen again."