NEW YORK (AP) _ Thomas Ravelli, the 38-year Swede who holds the record for national team goalkeeper appearances with 147, agreed Thursday to a multiyear contract with Major League Soccer.

Ravelli, ejected from a game for the first time in 1983 in IFK Goteborg's 2-1 loss Wednesday in the European Champions Cup, will be assigned to one of MLS's 10 teams by the end of the month.

Ravelli has spent the last 21 years playing in Sweden's first division. He helped Sweden to a third-place finish in the 1994 World Cup.