Four people have been injured and five cars damaged after strong winds brought down a large tree across a road in Sydney's south-west on a day of wild weather across NSW.

The large gum tree fell onto vehicles on the Hume Highway at Warwick Farm just before 4pm on Friday as wind gusts of up to 100km/h battered Sydney, cutting power to more than 40,000 homes and ripping the roof off a Sydney apartment building.

One woman was in a serious condition at Liverpool Hospital after the tree fell at Warwick Farm, while three men were in a stable condition.

The road was closed in both directions as crews attempted to clean up the debris. By 11.30pm the tree near Governor Macquarie Drive had been cleared, but electrical crews remained on the scene repairing overhead wires. One lane of the Hume Highway remained closed in each direction.