A young boy has been charged after allegedly firing a rock with a slingshot at a passing road train in WA's Mid West.

The 10-year-old was charged following the incident in Meekatharra on Sunday afternoon.

Police say about 3.15pm, the driver was travelling in his road train along Great Northern Highway.

As he approached the Meekatharra town site he noticed some children standing on the verge.

The boy allegedly fired a rock at the truck, which smashed the passenger side window and showered the driver with glass.

Police say the driver was transporting explosives at the time and was lucky to avoid injury as he maintained control of the truck.

Police have charged the 10-year-old boy with causing fear or alarm to a driver of a conveyance.