Young talent Joe Dodoo, who scored a hat-trick in Leicester's 4-1 win over Bury in the second round, gave his side a sixth-minute lead at King Power Stadium when the ball fell nicely for him to powerfully side-foot past Adrian.
There were chances at both ends throughout with Hammers keeper Adrian the busier of the two glovemen while the visitors may have been unlucky not to have a penalty when Danny Simpson felled Mark Noble in the area but referee Peter Bankes instead booked the veteran midfielder for simulation.
Adrian continued to keep his side in the contest before King's header in the 116th minute, from Christian Fuchs' pinpoint delivery, settled the matter in the East Midlands.
2015/16 CAPITAL ONE CUP - THIRD ROUND
Need a VPN? Or seeking to switch? Then support Tribal Football by clicking here to sign up with our official partners NordVPN. Not only will you receive the best VPN experience, but also great discounts by signing up via Tribal Football. Thanks for your support!