The 25-year-old's previous deal had been due to expire next month, which would have made him a free agent.
However, he will now spend another two seasons at the Globe Arena.
"Andy has had a great season and has all the credentials needed to be one of the best midfielders in the Football League," manager Jim Bentley told the club's official website.
"There has been interest from other clubs in him and I am delighted that he has agreed to join us again. He is a big player for us and a big signing and I'm sure he will just get better and better."
Fleming, who joined Morecambe from Wrexham in 2010, scored seven goals last season.