According to bbc news
The girl took the family’s AK-47 assault rifle, shot dead two of the militants and wounded several others, local officials in Ghor province said.
The Taliban came to the house because the girl’s father was a government supporter, they added.
A photo of the girl holding the gun has gone viral in recent days.
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.
Social media users praised the teenager.
“Hats off to her courage,” AFP quoted Najiba Rahmi as saying on Facebook.