More than 300 motorists have been cited by the state police in Virginia for texting while driving since the act became a primary offense, authorities said.

The crackdown is part of an increasing nationwide effort to halt the practice, which is viewed as a major highway menace.

The Virginia law authorizes police to stop motorists merely for texting, without the need to observe any other infraction. It went into effect July 1. Texting is also a primary offense in Maryland and the District.

In a statement, the state police said troopers had stopped and charged 328 motorists for violating the texting law as of Sept. 28.

Troopers “have been enforcing it just like any other primary offense,” the state police said. Texting puts all other motorists at risk, the police said.