The Arizona Cardinals and former Cleveland Browns quarterback Derek Anderson have agreed to a two-year contract worth $7.25 million, a source told ESPN.com Wednesday.

The source said the deal includes $3.25 million guaranteed, and with incentives would max out at $18.25 million.

Anderson would compete with current Cardinals quarterback Matt Leinart for the starting job.

Leinart had been the only quarterback on Arizona's roster following the retirement of Kurt Warner.

"We have seen a tremendous amount of growth from Matt. He has worked hard," coach Ken Whisenhunt said Wednesday, "but I am also excited about Derek and there will be competition at that position. That's not anything different than what we have at other positions."

Anderson was released by Cleveland on March 9, ending an uneven five-year stint with the team. He made the Pro Bowl in 2007 when he threw 29 touchdown passes and led the club to a 10-6 record.

"I think a fresh start was something that I wanted," Anderson said in a conference call, "getting out of Cleveland and getting out there and compete and kind of prove that I can play. 2007 was a great year, but the last couple of years haven't been, obviously, good for me or the team I was playing on. So I am just excited about a new opportunity with a new team."

Anderson visited the Cardinals last Friday. He also made a stop in Seattle. Anderson knows Leinart is ahead of him on the depth chart.

"It was understood to me that I was going to be the No. 2 and come in and compete and do what I've done over my career," he said. "I am coming into camp and everything like that and I've gone into every training camp I have been involved in thinking I am going to play and get better. Obviously, my job will be to push Matt and make him better, too."

Whisenhunt said he got a text from Leinart on Wednesday saying he "knew there was going to be competition, but he was going to show he was ready to play. "

"So that indicated to me that Matt was in a good place," the coach said. ".... I don't know necessarily that it was a function of any announcements about us reaching an agreement with Derek as much as it was just Matt staying in communication. That is what we want from our players and I was excited to see that."

Information from ESPN.com's James Walker and John Clayton, ESPN NFL Insider Adam Schefter and The Associated Press is included in this report.