The Morocco international, 27, becomes the first signing for new manager Paul Lambert after helping Feyenoord to reach the Champions League last season.
El Ahmadi joined Feyenoord from FC Twente in the summer of 2008 and spent a spell on loan with Dubai club Al Ahli during the 2010-11 season.
"I'm very excited about coming here to a massive club and I'm looking forward to playing here," he told the club's official website. "I'm very happy that the manager wants me and that the club wants me and I'm looking forward to starting training again.
"It's nice that I am the manager's first transfer and I am looking forward to doing good things with the team and with the club this year. This club should be competing in the top half of the table and I am looking forward to achieving that with the team.
"It was always a dream of mine to play in the Premier League. We played a lot on Sundays in Holland, so I was able to watch all of the games on Saturday and I think this is the best league in the world. It will be a challenge to show people what I can do."
El Ahmadi is the second signing of the summer for Villa, who have also signed Australia international Brett Holman from Eredivisie club AZ Alkmaar. However, the deal was arranged before the appointment of Lambert.
"Karim will help the team, I have no doubt about that," said Lambert. "He's a really good footballer and he's played well in a good team, a big team, and I'm looking forward to working with him.
"In fact, I'm really looking forward to getting things going on Thursday when the lads will report back for pre-season."