PORTLAND — A Brunswick man has been sentenced to two years in prison for defrauding two well-known Maine companies that he had worked for out of nearly half a million dollars.

Matthew LaForge was sentenced on Tuesday in U.S. District Court in Portland after pleading guilty in August to mail fraud and tax evasion charges.

Court records show that while employed at South Portland-based Wright Express from 2006-2008, the 38-year-old LaForge fraudulently billed and collected $231,000 from the company for marketing services supposedly provided by a company that he made up.

Prosecutors say LaForge used the same scheme to defraud Freeport-based L.L. Bean out of $220,000 while working there as a financial analyst from 2009-2011.