William Shatner invaded Seth MacFarlane's opening Oscars sketch to add a science fiction plot line to the Academy Awards. Captain James T. Kirk (suspiciously wearing his admiral's uniform and sounding less like Shatner doing Kirk than Shatner doing grumpy Shatner) traveled back in time to prevent MacFarlane from being the worst Oscar host ever, showing the offensive sketches from the original timeline and prompting MacFarlane to replace them with classier ones. The musical sequences (and Sally Field's cringing) are fantastic, but the Kirk bit wore thin pretty quickly—and our brave captain/admiral/Shatner refused to return to his own time for many, many minutes.
Edit: It's been pointed out that Kirk is wearing a Captain's rank insignia, not an Admiral's.
Also, the original YouTube video has been removed. Watch the segment below: