Sergio Aguero scored twice as Manchester City saw off West Ham to go fourth in the Premier League.
City tore through the middle of the Hammers' defence for their opener, with Alvaro Negredo leaving Fernandinho's pass for Aguero to calmly slot home.
Aguero made it 2-0 with a header from David Silva's free-kick but Vaz Te replied with an acrobatic strike.
That set up a tense finish, until Silva found the top corner to seal City's first away league win of the season.
City's form on the road has been the biggest concern for new manager Manuel Pellegrini this season, and they badly needed a solid display in the first of four successive away games in the league, Champions League and League Cup.
Aguero at the double
This was the third time that Sergio Aguero has scored more than once away from home in a Premier League away match - he also scored twice in the 2-2 draw at Fulham on 18 September 2011 and 14 April 2012 - when he scored two in the 6-1 win at Norwich.
They began strongly in east London, establishing a platform in midfield and controlling that area of the pitch.
West Ham were chasing shadows and City's slick movement and passing saw them take an early lead through Aguero, who galloped clear unopposed after 16 minutes.
That was only the second goal West Ham have conceded in open play in the Premier League this season, but Sam Allardyce's side were looking vulnerable every time City came at them.
Aguero made space for another shot that just eluded Silva after squirming out of Jussi Jaaskelainen's grasp, while the Hammers keeper did well to keep out a curling Yaya Toure shot after a mistake by Winston Reid.
The home side, who were again operating without an out-and-out striker, did enjoy spells of pressure too but they lacked a cutting edge when they put the ball into the box and ended the first half without managing a shot on target.
Things got bleaker for West Ham after the break when Aguero met Silva's free-kick with a pin-point near-post header - his first in the Premier League - to double City's lead.
But the Hammers responded with their best spell of the match, culminating with Vaz Te's overhead kick after Ravel Morrison had hooked the ball back into the danger zone.
City had gone ahead in both of their away Premier League defeats this season, and their lead looked fragile again as West Ham bombarded their box with crosses and free-kicks.
This time, however, there was a different outcome.
In contrast to their displays in defeats at Cardiff and Aston Villa, Pellegrini's side kept their defensive discipline, and got their reward at the other end too.
Negredo could have settled City's nerves when he slammed an angled shot against the underside of the bar, while Jaaskelainen had to be alert to keep out efforts from Aguero and Aleksandar Kolarov.
Instead it was down to Silva to put the game beyond West Ham's reach.
He met Aguero's clever backheel on the edge of the area to curl an unstoppable shot into the top corner and ensure City embark on their next trip, to CSKA Moscow in the Champions League on Wednesday, on the back of a win.
West Ham boss Sam Allardyce:
"City were very, very good. Because they were so good we could not get near our best.
"The lads had a right go after going 2-0 down. Before that, we were nowhere near our best. We had to be at our best, and they had to have an off day, for us to beat them.
"For the size, power and money they have, we could not live with them today. It showed at times.
"We could have felt sorry for ourselves and lost 4-0, but we made a spirited comeback. We did not find the form we had at Tottenham.
"It did not work today. The lads did not apply themselves as well."
Manchester City manager Manuel Pellegrini:
"Winning the game was the most important thing for us. We played very well, and the best player for West Ham was their goalkeeper.
"We played as well as we did against Aston Villa [when City lost 3-2]. Someone asked me if I needed to change the way we played away, and I do not think so.
"This team should always play in attacking way because of the players we have.
"We were absolutely sure playing the way we were, we would win away. We lost against Cardiff and Aston Villa, but football is like that."
West Ham United
- 22 Jääskeläinen
- 20 Demel (O'Brien - 65' )
- 08 Rat
- 16 Noble
- 05 Tomkins
- 02 Reid
- 23 Downing
- 04 Nolan Booked (Petric - 83' )
- 21 Diamé
- 15 Morrison
- 12 Vaz Te (Jarvis - 65' )
- 07 Jarvis
- 13 Adrián
- 14 Taylor
- 17 O'Brien
- 24 Cole
- 26 Cole
- 30 Petric
- 01 Hart
- 02 Richards
- 22 Clichy Booked
- 42 Yaya Touré
- 14 Javi García
- 33 Nastasic
- 08 Nasri (Milner - 74' )
- 25 Fernandinho
- 16 Agüero (Jovetic - 82' )
- 09 Negredo (Kolarov - 66' )
- 21 Silva Booked
- 05 Zabaleta
- 06 Lescott
- 07 Milner
- 10 Dzeko
- 13 Kolarov
- 30 Pantilimon
- 35 Jovetic
Ref: Michael Oliver