There were jubilant cheers from pro-Union campaigners as a No result was returned for the Midlothian constituency.
Returning Office Kenneth Lawrie announced that a total of 33,972 votes were cast for No while a total of 26,370 votes were cast for Yes.
A total of 53 votes were rejected.
The turnout for the Midlothian was 86.8 per cent, with 60,396 voters returning a ballot paper from a total registered electorate in Midlothian of 69,613. The electorate included 1747 young voters.