© Getty Images
However, England, who struck the woodwork twice in the second half, were undone in the dying moments when Bassett's sliced clearance found her own net to end England's World Cup journey in Canada.
The Lionesses have gripped their nation as of late after becoming only the second England side to reach the last four of a World Cup since the men's triumph of 1966.
With just 37 seconds on the clock, Jodie Taylor came agonisingly close to ensuring a dream start when her half-volley flew narrowly past the post.
Japan slowly but surely settled into the contest and went close on 20 minutes when Aya Sameshima latched on to Miyama's through-ball, but her final effort sailed over the bar.
It was a sign of things to come, though, as the defending champions opened the scoring on 31 minutes when Miyama coolly slotted a penalty beyond Karen Bardsley after Claire Rafferty fouled Saori Ariyoshi.
The lead only lasted some eight minutes, however, as Williams fired England level from the spot when Yuki Ogimi conceded another penalty to preserve England's hopes of reaching the final.
Sampson's side were unfortunate not to move ahead on the hour mark when Toni Duggan's effort crashed off the crossbar, before second-half substitute Ellen White was denied by a smart save from Ayumi Kaihori.
On 78 minutes, the woodwork conspired to deny England once more as Rafferty's cross-cum-shot rattled the bar, as Japan - who minutes earlier went close through Mizuho Sakaguchi - narrowly survived in an end-to-end last quarter.
Those close shaves proved costly as Bassett, with seconds left to go until extra time, rifled the ball past Bardsley with a huge slice to eliminate England and leave the defender in floods of tears.