Asda and Sainsbury are to pull online deliveries in areas across the country where drivers feel intimidated, following a move by both supermarkets to drop the service in parts of Edinburgh this month.

They have both stopped delivering to postcodes starting EH14 2 in the city, affecting about 4,500 homes in Longstone, Redhall, Morvenside, Murrayburn, Quarrybank and Dumbryden, because drivers fear for their safety.

Sainsbury's web site now states that the postcode is outside its delivery area, while Asda.com states "we do not currently deliver to this area".

A spokesman for Asda confirmed that it had suspended deliveries, although some areas had now been reinstated. He added that it had been forced to stop deliveries because two of its drivers had been shot at with an air rifle. In one incident in Dumbryden the driver escaped unharmed, but in the second incident, a driver was shot in the leg.

A spokeswoman for Sainsbury said: "We have had to stop deliveries to one postcode in Edinburgh because of issues over driver safety. We didn't take the decision lightly, but ultimately the safety of our colleagues is paramount and if we feel it's being compromised it's our duty as a responsible retailer to take the appropriate action. We have sent correspondence to all customers in the area to fully explain the reasons behind the decision."

A spokesman for Tesco said that although it had suspended deliveries in certain areas in the past, it would continue to deliver to the Edinburgh postcode. Earlier this year, it stopped delivering to the Oxmoor Estate in Huntingdon, near Cambridge, after drivers' safety was put at risk. However, both Sainsbury and Waitrose continued to serve the area.

David McLetchie, MSP for Edinburgh Pentlands, called for Asda and Sainsbury to reinstate services.

He was concerned that "one or two incidents may have become the justification for widespread blacklisting".