It means that Malky Mackay has sorted his goalkeeping options long term with Marshall's contract and Joe Lewis signing this week.
Lewis replaces Tom Heaton who left the club this summer after his contract ended.
“It’s great committing to the club for the next three years at least,” said Marshall.
“I had a year left on my current deal which would have taken me through next season, but the gaffer pulled me not so long ago and told me he wanted to offer me a new deal.
“I was more than happy to sign it and the process has been quite straight forward from start to finish.
“It was an easy decision for me to extend my deal here. I hadn’t even brought up the prospect of extending at this stage, but, as I say, the gaffer told me I was part of his plans.
“The gaffer was a big part of my decision to stay here. He gave me the chance to get back fit and prove myself back last summer and I appreciated that. I want to be able to repay him now on the pitch and kick on again.”