The M2 motorway remains closed to city-bound traffic after a fatal truck crash at Baulkham Hills in Sydney's north-west.

Police said two semi-trailers collided on the motorway, between Abbott and Windsor roads, about 2.30am on Wednesday.

A NSW Police spokeswoman said both trucks were believed to have been heading towards the city when the front of one truck collided with the rear of the other truck.

The force of the crash was so great that one of the trucks became wedged beneath the trailer of the other.