Blackburn magistrates heard Paul Thomas Sweeney was walking with his pants around his ankles and turning to face passing traffic.
And an officer who went to investigate a number of complaints found Sweeney at the side of the road in the same revealing state of undress.
Sweeney, 38, of Albert Street, Clayton-le-Moors, pleaded guilty to intentionally exposing himself. He was made subject to a community rehabilitation order for 12 months and placed on the Sex Offenders Register for five years.
Francis McIntee, prosecuting, said a female motorist was travelling along the A59 when she saw someone in the road.
"There could hardly have been an appropriate road sign to warn her of what she was about to encounter," said Mr McIntee.
"She had to swerve to avoid hitting him and, looking in her mirror, saw him repeat the behaviour as the next car approached."
Mr McIntee revealed that Sweeney had previous convictions for indecent exposure and gross indecency.
Imran Hussain, defending, said his client was a man with many problems. He had been drinking heavily that day.
Comments: Our rules
We want our comments to be a lively and valuable part of our community - a place where readers can debate and engage with the most important local issues. The ability to comment on our stories is a privilege, not a right, however, and that privilege may be withdrawn if it is abused or misused.
Please report any comments that break our rules.
Read the rules hereComments are closed on this article