It was Hamilton’s second win in five races this season and the 55th of his career. The success brings him within six points of Vettel in the drivers’ championship.
"That is how racing should be," said Hamilton. "Seb was really fast. My start was not good enough. The team did a great job this weekend."
After being edged into second place, Vettel said: "I had a really good start. I stayed ahead and then got into a nice rhythm. But Lewis was fast, too. He just flew past me down the straight. It was a shame. But it was a nice race."
Hamilton attributed his recovery to key decisions including a change to a set of medium tyres at his first stop, while Vettel remained on softs.
"That was a very tough race," added Hamilton who started in pole position. "Physically it was hard. I was really straining to keep up with Seb. It is a real privilege to race against someone as good as him."
Ricciardo was more than a minute adrift of the leaders and finished ahead of Sergio Perez and his Force India team-mate Frenchman Esteban Ocon.