Media reports say a teenage Afghan girl has been hailed on social media for her "heroism" after fighting back last week against Taliban militants who killed her parents.

“Qamar Gul, who was inside the house, took an AK-47 gun the family had and first shot dead the two Taliban fighters who killed her parents, and then injured a few others,” Habiburahman Malekzada, a police chief, said, according to National Post.

The Taliban came to the house because the girl's father was a government supporter, they added.

The BBC says that later more militants came to attack the house, in the village of Griwa, but were beaten back by villagers and pro-government militia.

Officials said the girl, believed to be aged between 14 and 16, and her younger brother had been taken to a safer place.

The girl’s brave move has gained widespread attention on social media, with Twitter and Facebook users quick to praise her actions.

According to Afghan media, Ghor is one of the most underdeveloped western provinces of Afghanistan and incidences of violence against women are high.

The Taliban signed a peace deal with the US in February but many of its members continue to call for the overthrow of the current Afghan government and constitution.