Hannity appeared on the podium with the president and delivered brief remarks. Another Fox News host, Jeanine Pirro, also appeared onstage with the president.
Hannity, cable news' most popular personality, told the crowd, "By the way, all those people in the back are fake news."
It was an extraordinary scene after the news network had worked Monday to establish distance between Hannity and the campaign. Trump's campaign had billed Hannity as a "special guest" at the rally, but Fox had said that wasn't so, insisting he was merely broadcasting his show from the arena.
During his prime-time Fox show, Hannity played the role of cheerleader from the side as the crowd waited for Trump's appearance. He pleaded with viewers to vote Republican on Tuesday to support Trump, and his opening monologue echoed a campaign slogan seen on signs overlooking the stage: "Promises made, promises kept."
Hannity described the scene at the Missouri arena as "almost like a rock concert atmosphere without a guitar."
He moved backstage, and with six minutes before the end of his show, Trump appeared for a billed interview that was largely bereft of questions.
Hannity's rally appearance was not broadcast on Fox.
Hannity's role at the rally had been put in question by Trump campaign itself. It announced on Sunday that Hannity was to be a guest, along with radio commentator Rush Limbaugh and singer Lee Greenwood.
Michael Glassner, chief operating officer for the campaign, was quoted in Sunday's news release. He did not immediately return a request for comment Monday on Hannity's role. A Fox spokeswoman said she didn't know how that impression had been created.
Despite Fox's disavowal, the Trump campaign continued to list Hannity as a guest throughout Monday at the link where people could seek tickets to the event.
Hannity was rebuked by Fox in 2010 when it found that the Tea Party had advertised Hannity would be appearing at one of its fundraising rallies, where participants could pay a premium for seats near the set where Hannity was broadcasting his program.
Fox said it had not approved the arrangement, and ordered Hannity back to his New York studio for the evening. The Fox News executive who was quoted explaining in a newspaper report why Hannity's appearance was disallowed was Bill Shine — now Trump's communications director.
Associated Press writer Lou Kesten in Washington contributed to this report.