TRENTON, N.J. — A former New Jersey lawmaker pleaded guilty Friday to stealing nearly $1.9 million from people who loaned him money for a business venture and writing more than $3.4 million in bad checks to other creditors.

Former Republican Assemblyman Robert Schroeder pleaded guilty to a charge of second-degree misconduct by a corporate official.

The state will recommend that he be sentenced to eight years in state prison. He will be required to pay back the more than $5.3 million he stole from his victims and be barred from public employment.

Prosecutors say that Schroeder convinced creditors to give him money for a project that he said would supply housing at a North Dakota oil drilling project. He instead used the money for personal expenses and other debts.

He had served two terms in the Assembly from 2010 to 2014, representing a district that includes parts of Bergen and Passaic counties.