In 2007, McCain co-sponsored controversial legislation with Senator Ted Kennedy known as the Comprehensive Immigration Reform Act of 2007 which would have allowed tens of millions of illegal immigrants already in the United States a path to citizenship.