Traffic was diverted from the stretch between the Kingsknowes roundabout and Boleside, the Traffic Scotland driver information service reported.
The blaze involved 2,000 square feet of gorse and grass, which also damaged power cables.
Some 20 firefighters and four fire appliances from Galashiels, Selkirk, Hawick and Innerleithen tackled the blaze.
The Scottish Fire and Rescue Service said the alarm was raised at 9:54am and the road was re-opened around 2pm.
A spokeswoman said: "Firefighters tackled a large gorse fire near A7 towards Selkirk.
"Crews used powerful water jets and beaters to tackle the flames, which affected an area of 100m by 20m.”
A spokesman for Amey, the company responsible for maintaining the road, said: "A request was received from Police Scotland to provide a closure and diversion route at the A7 Kingknowes roundabout due to a gorse fire breaking out adjacent to the carriageway.
"There was concern the fire would spread to the nearby tree line, creating a further hazard.
"As ever, the safety of the travelling public remains our primary concern, and we thank road users for their patience and support."
The fire is the latest in a series of grass fires across Scotland in the last two weeks.