WASHINGTON — Historic immigration legislation cleared a key Senate hurdle with votes to spare on Monday, pointing the way to near-certain passage within days for $38 billion worth of new security measures along the border with Mexico and an unprecedented chance at citizenship for millions living in the country illegally.

The vote was 67-27, seven more than the 60 needed, with 15 Republicans agreeing to advance legislation at the top of President Barack Obama's second-term domestic agenda.