Reports said those killed were shot dead in chaotic fighting at Suruc in the Sanliurfa region, although rival sides gave starkly contrasting versions of events.
The incident added to tensions ahead of the June 24 elections, where Erdogan will seek a second term as president and also a thumping majority in parliament.
The Sanliurfa governor's office said a fight erupted between two groups during the visit by MP Ibrahim Halil Yildiz to small businesses in the centre of Suruc.
It said three people were killed and nine wounded in an "incident" that took place afterwards. It did not confirm reports that a shooting had taken place.
Turkey to extend state of emergency for seventh time
Both the Anadolu and Dogan news agencies said there was a shooting and video reports from the scene published by Dogan contained the sound of gunfire.
One of the victims later died in hospital from the wounds sustained in the attack, Anadolu said, bringing the death toll to four.
The lawmaker escaped unharmed, the reports said, but the identity of all the victims was not immediately clear.
There were conflicting reports about the circumstances of the killings, with pro-government media saying Yildiz and his supporters came under attack from opponents armed with knives and sticks.
The state-run Anadolu described it as an attack against the ruling Justice and Development Party (AKP) and added that among those killed was the MP's brother.
It claimed that supporters of the pro-Kurdish Peoples' Democratic Party (HDP) were among those involved in the attack.
In his first reaction to the incident, Erdogan appeared to blame the bloodshed on the HDP and the outlawed Kurdish militant Kurdistan Workers Party (PKK).
"This is the most obvious example that the HDP and PKK have not been able to abandon basing their growth strategy on feeding off the blood of Kurds," he said.
"We have no problem with our Kurdish brothers. We have a problem with the PKK," he said.
But unconfirmed reports on pro-Kurdish media blamed the MP's bodyguards for the attack, after he was met with hostility during the visit to the shopkeepers.
"We are faced with very sad events with just days to go before June 24," said the HDP's co-leader Pervin Buldan.
"We see that some are trying to incite the people with provocations," she added, condemning those behind the killings.
Russia, Iran, Turkey to meet on Syrian constitutional committee: UN
Reports indicated that the fighting had initially broken out after a dispute between Yildiz and a local representative of the Democratic Regions Party (DBP) which is close to the HDP.
After the first clashes, fighting even continued at the hospital where the wounded were brought, reports said.
Suruc, a mainly Kurdish town, was the scene of a bombing on July 20, 2015, blamed on so-called Islamic State (IS) that killed 34 people and wounded about 100.
That bombing sparked huge tensions in Turkey at the time, with many Kurdish activists taking to the streets and accusing the government of not doing enough in the fight against IS.
Turkey is entering what is expected to be a tense final week of campaigning ahead of the polls.
Analysts are forecasting that the parliamentary and presidential elections will be tight, with Erdogan possibly forced into a run-off and with his ruling party at risk of losing its overall majority in parliament.
One of the crucial questions will be whether the HDP is able to exceed the 10 per cent threshold needed to win seats in parliament. If it does, the AKP's chances of winning an overall majority will be sharply reduced.
HDP presidential candidate and former leader Selahattin Demirtas is campaigning from behind bars following his arrest in November 2016 on charges of links to the PKK.
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ