Maryland Gov. Larry Hogan (R) on Monday proposed legislation to allow state employees to pay into a 401(k)-style retirement plan instead of the state’s public-pension system, sparking immediate criticism from unions that represent the workers.

The plan would give future state employees the option of participating in a “defined contribution” program in which they and the state would each contribute an amount equal to 5 percent of pay toward individual retirement accounts.

Those who did would not be part of the state’s public-pension program, which provides guaranteed payouts at levels that depend on length of service and other factors. All state workers currently pay into that system, but only those who have worked with the government for at least 10 years are entitled to benefits from it.

Employees who are currently working for the state would not be allowed to participate in the 401(k)-style program under Hogan’s legislation, because of Internal Revenue Service regulations that govern transfers of retirement savings between plans.

Hogan excluded teachers from the proposal because the teachers union has strongly opposed such changes to the retirement system for its members, a spokeswoman for the governor said.

Hogan said his proposal would free up funding that could shore up the public-pension system, which the state in recent years has struggled to fund at levels that will sustain it in the long run.

“The legislation will safeguard pension contributions and create a long-term and stable structure that will meet the needs of retired, current and future state employees,” the governor said.

Public-employee unions said the proposal would reduce funding for the pension system and leave participants in the proposed 401(k)-style program vulnerable to stock market volatility.

Patrick Moran, president of AFSCME Maryland Council 3, the largest labor union representing state workers, called Hogan’s legislation “an awful idea,” saying it would “destabilize” the pension system.

Sen. Guy J. Guzzone (D-Howard), who co-chairs the legislature’s joint committee on pensions, expressed skepticism that the majority-Democratic legislature would advance the measure but said his panel would give it “the courtesy of a careful review.”

“Any kind of changes like this could have significant impacts on existing plans, existing employees and retired employees,” Guzzone said. “We’ll have to get our actuaries to do a complete analysis of it.”

Guzzone also noted that the state already offers its employees a 401(k)-style retirement benefit as an optional supplement to the public-pension plan.