The more serious accident took place at about 4pm at Little Swinton when a rally car came off the road and hit spectators.

The three victims were pronounced dead at the scene. Another two fans are in Edinburgh Royal Infirmary in a critical condition.

Superintendent Phil O'Kane of Police Scotland said officers were working to "forensically and sympathetically remove the deceased" from the scene.

He added: "We secured the scene last night, it was fading light, and the practicalities meant body removal was not an option, so they will be recovered over the course of today and police are working on that.

"We will also ensure we contact the next of kin and we will put in place all necessary family support for them."

The rally car remains at the scene of the accident with two white tents also erected on the road. A forensic officer was also seen filming at a junction close to where the crash took place.

A police cordon is in place at the entry to the road and a bunch of flowers have been left beside a tree in tribute to those who died.

Video Loading

Video Unavailable

Click to playTap to play

The video will start in 8Cancel

Play now

Two hours before the fatal crash another car in the rally left the road and hit five people, one woman and four men, near Crosshall Farm on the Eccles stage of the competition.

Three of the men were taken to Borders General Hospital but one was then moved to an intensive care unit in Edinburgh. The remaining two spectators were treated for minor injuries.

A number of local roads around Little Swinton remain closed as a result of the ongoing investigation into the crash

Mr O'Kane, strategic commander for the incident, said: "We still have a scene we are protecting where the fatalities occurred."

The rally, which was due to finish today, was immediately abandoned after the fatal crash yesterday afternoon, with emergency services called out to the scene.

About 250 competitors had been taking part in the event, the police said, with thousands of spectators watching the action.

Mr O'Kane described the rally as a "significant event", adding: "It's taken place for 44 years, it's one of the largest rallies in the UK."

After the first crash the Eccles stage of the event was suspended, but the rally was only abandoned after the second incident.

The police officer said he thought the rally organising committee "would have considered it was safe to move on to the next rally stage" after the first accident.

He added: "It's the nature of the event, a rally on open roads that the public have access to. Although safety barriers are put in place there are not stewarding positions along the whole route.

"It's a high energy and a high adrenaline sport and people want to take the best positions."

Eyewitnesses to the fatal crash described "terrible" scenes.

Spectator Tony Cowan told the BBC: "It was just one car which lost control. It went sideways one way and then to the other side of the road and ploughed into four people.

"It was terrible, absolutely terrible. I ran to help but there was little I could do. The air ambulance arrived after about three quarters of an hour. There were police cars and ambulances. It was chaos, just chaos."

In a statement yesterday the organisers of the Jim Clark Rally offered their "heartfelt condolences and sympathy" to all those affected by the "tragic events".

They added: "Our thoughts are especially with those who have lost family members and to the families of the injured spectators.

"All members of the organising team are in shock and are cooperating fully with Police Scotland to establish the facts."

The rally is named after Scottish Formula One driver Jim Clark, who grew up in the area and was killed in a motor racing accident in Hockenheim, Germany, in 1968.

Scotland's First Minister Alex Salmond spoke of the "desperately sad and difficult news from the Borders of the tragic circumstances that have occurred at the Jim Clark Rally"

He added: "My thoughts are with all of those involved and the families and loved ones of those who have lost their lives.

"The Government is in contact with Police Scotland and we await the outcome of their inquiries.

“The Jim Clark Rally is a longstanding event of over 40 years.

"It is much loved in the Borders and by the rally driving community who I know will share in our sadness at what is a black day for the Borders and for Scotland.”

Local MSP John Lamont said: "This is tragic news for the Borders, and my thoughts and prayers are with the victims and their families.

"I live just a few miles away from the scene of the accident and I know that everyone is shocked and saddened by this dreadful news."