The A-lister, who voices Sheriff Woody in the much-loved Pixar series, said putting down the vocals for the film's emotional denouement triggered a "transcendental moment".
Speaking on the red carpet in London's Leicester Square for the film's European premiere, Hanks said he had been forced to "collect himself" after becoming emotional.
The 62-year-old said: "I got a text from Tim Allen, who said: 'Have you seen these last few pages?' And I had not.
"He was still recovering from the process of recording them. I wasn't sure what the last page was going to be.
"We finished one sequence and they said: 'OK, thanks, you're done.'
"I actually had a transcendental moment of going back to 1991 when we started all of this.
"I was in the same room with the same engineers with some of the same people.
"I had to take a moment to collect myself."
The film also features returning characters including Buzz Lightyear (Allen), Bo Peep (Annie Potts), Jessie (Joan Cusack) and a new stuntman character voiced by Keanu Reeves.
The Oscar-winning US actor said he spent up to five hours alone in the recording booth to make sure his vocal takes were perfect.
But he admitted the sessions were "very lonely" and that he would often "stumble out".
Asked how it was working with John Wick star Reeves, Hanks replied: "The first time I heard that Keanu was going to be in it I was told: 'Oh there is this new character called Duke Caboom and Keanu Reeves is going to play him.
"And I just thought: 'That's the greatest idea I've ever heard.'
"But we didn't actually get to see each other until literally just before the movie came out.
"They keep us separated. It is a very lonely process.
"The recording sessions take about five hours because you have to get to all these emotional places on microphone.
"When you have finally done it you stumble out of the session and somebody coming in to the next session might be anybody from Tony Hale or Tim Allen or Annie Potts.
"You have about five minutes of: 'How's it going? Oh my lord how much have you done? Wait 'til you see what they have for you.'
"But you don't really see what they get to do until the movie's out."
Toy Story 3 won two Academy Awards and the franchise has enjoyed huge global success since the first film appeared in 1995.
Hanks also hailed the work of the animation team, adding: "I bow my head to the geniuses at Pixar. They do not take their duties lightly."
Other stars who hit the red carpet included singer Myleene Klass, former footballer Rio Ferdinand and partner Kate Wright, and McFly star Dougie Poynter.
Toy Story 4 is due for release in UK cinemas on June 21.