Marlon Harewood struck in extra-time to earn West Ham an FA Cup quarter-final against Manchester City.
Harewood gets in front of the Bolton defence to hit the winner
Harewood turned in a right-wing cross from Yossi Benayoun to clinch victory in an entertaining Cup tie.
The Hammers had gone ahead with an own goal by keeper Jussi Jaaskelainen after defender Nicky Hunt's poor clearance diverted off him and into the net.
Kevin Davies equalised with a swerving shot - and both sides had chances to win it before Harewood struck.
Harewood was also involved in the opener after escaping down the right.
He drilled in a cross which Hunt managed to drive against the prone Jaaskelainen and into the Bolton net from eight yards.
Tempers started to flare soon afterwards. Matthew Etherington, Kevin Nolan, Harewood and Tal Ben Haim were all booked in a 19-minute spell before Davies hammered the equaliser.
Referee Rob Styles played advantage after a foul, the ball running to the unmarked Davies, whose swerving shot from 20 yards was too powerful for Shaka Hislop to stop.
The goal lifted Bolton, who began to have their share of possession.
However, it was West Ham who nearly regained the lead just before half-time when Harewood played the ball into the Bolton area to Benayoun, whose shot was well saved by Jaaskelainen.
Bolton started the second half brightly, Ricardo Gardner twice coming close to putting the visitors ahead.
But West Ham hit back, with Harewood causing more problems and Benayoun heading past the far post.
The game was really opening up, and Nolan, substitute Henrik Pedersen and Davies all came close to putting Bolton ahead for the first time.
In the end, though, neither side could break the deadlock inside the 90 minutes and the game went into extra-time.
Bolton started the brighter and had two early chances, but it was West Ham who grabbed the crucial goal.
Benayoun advanced down the right and sent in a dangerous, low cross to the near post, where Harewood drove it across Jaaskelainen and into the net for his 14th goal of the season.
Bolton continued to dominate the extra period, and Jay-Jay Okocha, Davies and Hunt all had chances before the teams turned round.
The pressure continued in the final 15 minutes, although West Ham were dangerous on the counter-attack and substitute Bobby Zamora missed a great chance for a third.
But West Ham held on and now travel to the City of Manchester Stadium next Monday.
West Ham manager Alan Pardew:
"With the quality we've got, we have a real chance of going all the way to Cardiff and winning.
"I'm so proud of the players. They've been a credit to us and have shown they have a real strong spirit between them.
"Marlon Harewood's all-round display was terrific, although overall I didn't think we were at our best tonight."
Bolton boss Sam Allardyce:
"When looking at the replay Marlon Harewood is offside before the ball is played down the line to him, and that is clear.
"Sadly in an FA Cup tie, when that happens it can't even itself out.
"We should have put game away in the first 90 minutes and we haven't done that and paid a heavy price for it."
West Ham: Hislop, Konchesky, Gabbidon, Mullins, Ferdinand, Reo-Coker (Dailly 98), Scaloni, Etherington (Zamora 105), Benayoun, Harewood, Ashton (Sheringham 105).
Subs Not Used: Bywater, Clarke.
Booked: Etherington, Harewood, Reo-Coker.
Goals: Jaaskelainen 10 og, Harewood 96.
Bolton: Jaaskelainen, Ben Haim, Jaidi, Hunt (Borgetti 113), Faye (Pedersen 79), Nolan, Speed (Vaz Te 105), Giannakopoulos, Okocha, Gardner, Davies.
Subs Not Used: Al Habsi, N'Gotty.
Booked: Nolan, Ben Haim.
Goal: Davies 31.
Ref: R Styles (Hampshire).