Motorists in Maryland purchased a record 209 million gallons of gasoline in May, giving the state almost $30 million in tax revenue, officials said.

State Comptroller Louis Goldstein said Friday that the amount of motor fuel sold in May was a 6.9 percent increase over the 196 million gallons sold during the same month one year ago. The previous record for gas consumption was set in October, when motorists bought 207.9 million gallons in the state, he added.

The state raked in almost $29.6 million in motor fuel tax revenue in June, coming from the May sales. Goldstein said that figure was a 12.7 percent increase over the same month in 1986.

Maryland's gasoline tax was 13.5 cents per gallon until June 1. The Maryland General Assembly this year approved a 5 cent gas increase effective in June to help pay for more road construction and repair projects across the state in the next five years. Virginia's gas tax is a cent lower, while the District's is 15.5 cents per gallon.

For fiscal 1987, which ended June 30, gas tax revenue in Maryland totaled more than $332 million -- up 4.1 percent from the previous fiscal year.