Edinburgh - Scotland beat England by six runs to record the greatest win in their cricket history as they held their nerve in a lone one-day international at Edinburgh on Sunday.

Calum MacLeod's superb 140 not out powered non-Test nation Scotland to a record 371 for five against an England side who are top of the one-day international rankings.

The win came after Scotland agonisingly just missed out on a place for the 2019 World Cup in England and Wales after rain interrupted their decisive qualifying match against the West Indies at Harare in March.

It looked like England might overhaul it with ease during their Powerplay response as they rewrote a few pages in their own record books during a memorable run feast. Jonny Bairstow became the first Englishman to raise a century in three straight ODIs, dazzling the sellout crowd of 4600 with a 54-ball ton. But an inspired effort from spinner Mark Watt and medium-pacer Alasdair Evans brought Scotland back to life in the field, sparking a middle-overs collapse to see England fall from 220 for 2 in the 27th over to 365 all out. The match ended with seven balls remaining when Scotland paceman Saf Sharif had England No 11 Mark Wood plumb lbw to seal a famous victory, with the visitors all out for 365.

Scotland's biggest ODI stand for any wicket against England was the first record of the day to fall, previously a mark of 86 by Gavin Hamilton and Kyle Coetzer in 2010. That went down inside of 13 overs thanks to the brisk start from captain Coetzer and Matthew Cross. The pair were especially belligerent against David Willey, who gave up the first boundary of the day to Cross cutting through point in the second over and proceeded to get a beating throughout the Powerplay, eventually ending the day with 0 for 72.

Adil Rashid eventually stopped the bleeding at 103, getting Coetzer to edge behind just a few balls after Coetzer had driven him for six over mid-off for the last blow in his 58, his third half-century against England in five matches. Cross fell in the next over to Liam Plunkett, also edging behind, putting England close to even for the first time since the toss at 107 for 2 in the 15th.

But from there England had few answers to stop the Saltire surge. Another 93-run stand followed between MacLeod and Richie Berrington. Just as MacLeod had done to Rashid, he made excellent use of the sweep to England's tweakers, slog-sweeping Moeen Ali over deep square leg for six to bring up a 37-ball fifty.

He continued to play with freedom to bring up Scotland's first ever ton against England, doing it off 70 balls with a pinched two to mid-on a ball after his record-breaking 107-run stand with George Munsey had ended. Scotland's best individual score versus England prior to that was 71 by Coetzer at the 2015 World Cup. By the time MacLeod finished, he had nearly doubled it, walking off unbeaten on 140 off 94 balls.

But in this British boundary bonanza, the Bairstow bazooka was buzzing even faster than Scotland's batting brigade. The England opener entered the match coming off two straight ODI hundreds against New Zealand in March, the second of which was a 58-ball bashfest in Christchurch. He bettered that by four balls at the Grange, and for a brief period appeared on course to surpass Jos Buttler's English record 46-ball ton against Pakistan in 2015.

Bairstow reached his half-century off 27 balls in the midst of a brutal beatdown of Michael Leask in the ninth over, bludgeoning the offspinning allrounder for three sixes in the over. By the end of the Powerplay, England were 107 for 0, Bairstow on 75 off 35. But the wicket of Jason Roy, nudging a waist-high catch tamely back to left-arm spinner Watt in the 13th, broke England's rhythm.

Evans followed with a maiden to new man Alex Hales in the 14th, and Bairstow then survived a close lbw shout to Watt in the 15th in the 90s before reaching triple-figures off 54 balls in Evans' next over. He joined seven others with three straight tons (Kumar Sangakkara ran off four in a row during the 2015 World Cup) but fell at the end of the 18th for 105, driving Berrington's gentle medium pace high to Munsey at long-off.

Joe Root and Alex Hales forged a 55-run stand to keep the innings chugging along before Root was run out by Watt's relay to Leask over the stumps to end the 27th. Scotland were on a team hat-trick a few overs later, Morgan ending the 31st by miscuing Evans to Coetzer at midwicket before Hales loosely cut Berrington to Evans at backward point at the start of the 32nd.

At 245 for 5, the crowd began to believe that Bradburn's prophetic question might end positively for Scotland. That grew stronger when Coetzer's outstanding day in the field continued with a sharp low catch at midwicket off a low full toss from Watt to snare Billings for 12. Evans had Willey caught behind in the next over to put England seven down.

Moeen appeared poised to take England over the line, but holed out to long-on against Watt to leave 25 off 27 balls for the tail to get. It became 11 off 12 balls with Liam Plunkett batting brilliantly, but Rashid was run out from long-on coming back for a second to keep Plunkett on strike off the first ball of the 49th. Sharif, who starred in Scotland's World Cup Qualifier campaign, then struck the decisive blow four balls later, trapping Mark Wood leg before with a yorker to spark a wild pitch invasion and ensure the Scotland fans among the 4600 in attendance would party long into the night.

Scoreboard

SCOTLAND:
M Cross c Billings b Plunkett 48
K Coetzer c Billings b Rashid 58
C MacLeod not out 140
R Berrington c Root b Plunkett 39
G Munsey c Wood b Rashid 55
D Budge b Wood 11
M Leask not out 10
EXTRAS: (lb5, w5) 10
TOTAL: (5 wkts, 50 overs) 371
FOW: 1-103, 2-107, 3-200, 4-307, 5-360
BOWLING: Wood 10-0-71-1 (1w); Willey 10-0-72-0 (1w); Rashid 10-0-72-2; Plunkett 10-0-85-2 (3w); Ali 10-0-66-0
ENGLAND:
J Roy c & b Watt 34
J Bairstow c Munsey b Berrington 105
A Hales c Evans b Berrington 52
J Root run out 29
E Morgan c Coetzer b Evans 20
S Billings c Coetzer b Watt 12
M Ali c Munsey b Watt 46
D Willey c Cross b Evans 7
L Plunkett not out 47
A Rashid run out 5
M Wood lbw b Sharif 1
EXTRAS: (w7) 7
TOTAL: (all out; 48.5 overs) 365
FOW: 1-129, 2-165, 3-220, 4-245, 5-245, 6-263, 7-276, 8-347, 9-362, 10-365
BOWLING: S Sharif 9.5-0-71-1, C Sole 8-0-72-0, M Watt 10-0-55-3, M Leask 4-0-50-0, A Evans 8-1-50-2, R Berrington 9-0-67-2
TOSS: England
UMPIRES: Marais Erasmus (RSA), Allan Haggo (SCO)
TV UMPIRE: Kumar Dharmasena (SRI)
MATCH REFEREE: Ranjan Madugalle (SRI)