A nine-year-old girl has been rushed to hospital in a critical condition after she nearly drowned in a backyard swimming pool.