CHICAGO -- Aaron Miles wasn't happy about the St. Louis Cardinals' decision to non-tender him. The Cubs took advantage of the move.

Miles signed a two-year, $4.9 million contract on Wednesday with the Cubs, and he will essentially replace Mark DeRosa, who was traded to the Cleveland Indians for three Minor League pitchers.

"We expect Aaron to provide significant versatility and flexibility to our roster," Cubs general manager Jim Hendry said. "He handles the bat well from both sides of the plate, and is a skillful middle infielder who has added third base and all three outfield positions to his repertoire during the last few years."

Miles, 32, hit .317 with 15 doubles, four home runs, 31 RBIs and a .355 on-base percentage in 134 games for the Cardinals last season.

For the second consecutive year, St. Louis chose to non-tender Miles, and he became a free agent. That didn't sit well with him.

"I was a little surprised," Miles said on Wednesday. "I thought, given the situation and how well I did last year, that I was part of the team over there. Financially, I understand why they did it. It was still kind of shocking, because I figured I had a place over there.

"In the end, they non-tendered me two years in a row, and I felt that the attraction to me being there wasn't as big as it was before."

He made $1 million with the Cardinals in 2007 and $1.4 million in '08. If the Cardinals had tendered him a contract, he most likely would've received a significant raise.

The Cardinals did contact Miles shortly before he signed with the Cubs.

"They did make a last rush," Miles said, "but I felt in the end there was a situation where maybe I wasn't wanted by everybody, and in the end, I felt the Cubs were a better situation for me. The money was right and it's a chance to play for this team, which I feel is in contention for a World Series.

"I know the guys in St. Louis had a great year last year and we did some great things over there, but it just seemed right and the fact that the non-tendering of me two years in a row, it makes you feel you're not wanted as much. There was a little bit of that in my heart. ... St. Louis jumped in at the last minute. I'd pretty much said all my goodbyes in my head when they jumped back in. I'm excited to be playing for the Cubs."

The versatile infielder appeared at seven positions in the field last season, making 85 appearances at second base, 27 at shortstop, 11 at third base, four in left field, one in center and one in right. He also made one relief appearance on the mound.

Miles, who is a switch-hitter, will give Cubs manager Lou Piniella the same kind of versatility that DeRosa did as well.

Hot Stove

"It's changed the complexion of the roster," Hendry said.

Miles could leadoff, although last season, he batted mostly second.

"I'm really flexible with anywhere they put me," said Miles, who also batted ninth, because Cardinals manager Tony La Russa inserted the pitcher into the eighth spot. "I pride myself on executing the game plan wherever I am in the lineup."

Hendry said he envisions Miles being used either at the top of the order or seventh or eighth. He should handle the switch to Wrigley Field -- Miles batted .392 in day games compared to .277 at night.

Miles wouldn't have signed with the Cubs if they hadn't moved DeRosa, who's expected to be the Indians' third baseman. Sometimes, when you're able to play so many positions, it's hard to find regular work.

"For me, opportunity has been a big thing," Miles said. "The type of player I've been, sometimes the opportunity has not been as good as I'm going into now. Opportunity was big, and also the Cubs' management showed me financially they were really interested. To me, a team that wants me and a team that's expected to win -- and nothing less than the playoffs is acceptable for this team here -- I'm excited about it."

He's the second bat the Cubs have picked up this offseason, joining left-handed outfielder Joey Gathright, who also was non-tendered by the Kansas City Royals.

"We certainly didn't know a month ago that we'd be adding Gathright and Miles," Hendry said. "Once we add the outfielder we want to add [for right field], I think we'll take a good look at where we're at."

Miles is looking forward to the Cubs-Cardinals games. The first meeting between the National League Central rivals will be April 17-19 at Wrigley Field.

"Being a Cardinal was great," he said, "but that part is over now. I'm excited to be a Cubbie and play the game the right way and show St. Louis they let somebody go who maybe they shouldn't have."