(dmn) After months of treading softly on immigration, Barack Obama put the issue center stage Tuesday when he accused John McCain of setting aside years of support for a guest-worker program to appease conservatives and further his presidential ambition. The attack, delivered to a major Hispanic group, served the dual purpose of broadening Mr. Obama's appeal to a critical segment of the electorate, while chipping away at his rival's image as a maverick and reformer. "He used to buck his party on immigration ... but when he started running for his party's nomination, he abandoned his courageous stance," Mr. Obama told the League of United Latin American Citizens. "We need a president who isn't going to walk away from something as important as comprehensive reform when it becomes politically unpopular." Both candidates have walked a tightrope on immigration reform. The Arizona senator led a years-long push for new rules, cobbling together a package that included more border security and workplace enforcement with a guest-worker program and giving 12 million or so immigrants the chance to gain legal status. But a backlash from conservatives and two failures in Congress left him chastened. In the GOP primaries, he vowed to put security first before trying again for sweeping reforms – a stance he reiterated Tuesday at the LULAC convention a few hours before Mr. Obama spoke. "I and many other colleagues twice attempted to pass comprehensive immigration legislation," Mr. McCain said, adding that many Americans were skeptical after previous reforms failed to stem illegal immigration. "We must prove to them that we can and will secure our borders first. ... But we must not make the mistake of thinking that our responsibility to meet this challenge will end with that accomplishment." Hispanic advocates want a comprehensive package that offers a path to citizenship for illegal immigrants. On Tuesday, Mr. Obama explicitly promised to enact such a measure by the end of his first term as president. Mr. McCain was more circumspect and got a less enthusiastic reception as a result.