A young girl has needed surgery after a dog attacked her in Sydney's southwest.

Police were called after the four-year-old was bitten on the leg by the dog, believed to be a staffordshire cross, in Fairfield late on Saturday morning.

Her 44-year-old father was also bitten on the buttocks by the dog, which was found nearby, contained and later collected by council rangers.

The girl was taken to the Children's Hospital at Westmead, where she underwent surgery and is in a stable condition.