England needed a hero on the fourth morning at Edgbaston and Stokes stood up, as his three wickets, including Virat Kohli for 51, saw India fall short of their winning target and seal the opening game for the hosts, giving them a 1-0 lead in the five-match series.
Anderson gave England the perfect start
India began the fourth day at Edgbaston on 110-5, still needing 84 runs to win, while England needed five wickets to secure victory.
The key though for the visitors was that Kohli was still at the crease on 43 and he knew he was the man who had to see India through to the win.
Dinesh Karthik also returned to the crease with Kohli as the pair tried to keep their partnership going.
It didn't last long though as James Anderson removed Karthik for 20 in the first over in the morning to give he hosts exactly what they had hoped for.
Kohli notched up yet another half-century
That brought Hardik Pandya to the crease to join Kohli as the pair looked to see off the threat of Anderson and Stuart Broad.
It was working for the pair as Kohli went past yet another half-century and looked totally at ease at the crease.
Stokes took two wickets in an over including Kohli
This was until Joe Root introduced Stokes into the attack as the all-rounder trapped the Indian captain LBW for 51 to leave the visitors in real trouble.
It didn't take England long to get another wicket, as in the same over, Stokes removed Mohammed Shami for a third ball duck to leave the visitors on 141-8 still needing 53 runs to win.
It meant that Pandya was the man that had to get India over the line and alongside Ishant Sharma, the pair upped the scoring rate to put the pressure back on the hosts.
Rashid and Stokes finished off the Indian tail to seal victory for the hosts
Root then introduced Adil Rashid to bowling attack and once again it worked as he trapped Sharma LBW for 11 to leave England one wicket away from victory.
With only Umesh Yadav left, Pandya started to keep the strike when he could but in the end, Stokes removed Pandya for 31 to bowl India out for 162 to seal the win for England by 31 runs.