President Obama honored former president Lyndon Johnson at a ceremony in Austin marking the 50th anniversary of the signing of the Civil Rights Act. His remarks included a discussion of racism in America today and the role of the president in achieving progress. (The Associated Press)

The nation’s first African-American president on Thursday hailed the 50th anniversary of the law that abolished racial barriers, but he warned that complacency could undermine the decades of progress that made his election possible.

“Because of the civil rights movement, because of the laws President Johnson signed, new doors of opportunity and education swung open for everybody — not all at once, but they swung open,” President Obama said in an address at the Lyndon B. Johnson Presidential Library. “And that’s why I’m standing here today — because of those efforts, because of that legacy.”

But Obama added: “History travels not only forwards; history can travel backwards, history can travel sideways. And securing the gains this country has made requires the vigilance of its citizens.”

Obama was one of four U.S. presidents to speak at the three-day conference celebrating a half-century since the passage of the Civil Rights Act, which forbade discrimination on the basis of race, religion, sex or national orgin.

Former president George W. Bush also addressed the gathering Thursday, saying that one of the unfinished goals of the civil rights movement is assuring that all children achieve in school.

“On the issue of education, we’re dealing with the meaning of America, and the extent of its promise, and in this cause the passion and energy of Lyndon Baines Johnson still guides us forward,” Bush said.

Earlier in the week, former presidents Jimmy Carter and Bill Clinton also paid tribute to the anniversary — and to the legacy of Johnson, a president whose domestic achievements have long been overshadowed by the painful memories of the Vietnam War.

Obama, who during his first term was sometimes criticized for what some saw as a reluctance to address the issue of race, has spoken of it more often since his reelection. He has also become aggressive in promoting gay rights and equal pay for women and assuring the protection of voting rights.

“I think he feels freer,” said Rep. John Lewis (D-Ga.), an icon of the civil rights movement. “The election is behind him. He’s not going to run again. He’s not going to campaign again. So maybe his truer self is coming out.”

Lewis also said he hoped that Obama would take a page from Johnson’s playbook and push harder to win comprehensive immigration overhaul, which the congressman said is the next challenge of the civil rights movement.

“We need to do much more as members of Congress and the administration to fight for immigration reform,” Lewis said.

Obama and his aides have sometimes bristled at comparisons of his leadership with that of Johnson — who had deep personal relationships on Capitol Hill and an unrivaled mastery of the legislative machinery.

Rev. Jesse Jackson Sr. tells PostTV at the LBJ Library's Civil Rights Summit that proposals like the one President Clinton supports to put a photo on Social Security cards would not go far enough to support voter rights. (Theresa Poulson/The Washington Post)

After Johnson’s Democrats lost congressional seats in the 1966 midterm elections, “he had the same problems with Congress that most presidents at one point or another have,” Obama said in an interview last year with the New Yorker. “I say that not to suggest that I’m a master wheeler-dealer, but rather to suggest that there are some structural institutional realities to our political system that don’t have much to do with schmoozing.”

But Joseph Califano, who served as Johnson’s domestic policy chief, faulted Obama for missing the opportunities he has, even in a polarized political environment.

“I do think that he ought to take one more, or a couple more, really strong efforts to deal certainly with [House Speaker] John Boehner,” Califano said.

Califano noted that Boehner (R-Ohio) comes from a modest background, and said: “He knows something about life. And I can’t believe there isn’t some way to say to him, ‘Let’s sit down, let’s figure out some, couple of things we can do, and you tell me what you need to get some of those tea party guys. Maybe we can work it out.’ ”

In his speech Thursday, Obama suggested that his achievement in passing the Affordable Care Act is very much in the tradition of LBJ’s accomplishments, which included a government program to assure health care for the elderly.

Johnson championed “a health-care law that opponents described as ‘socialized medicine’ that would curtail America’s freedom but ultimately freed millions of seniors from the fear that illness could rob them of dignity and security in their golden years, which we now know today as Medicare,” Obama said.

What Johnson understood, Obama suggested, is that the presidency is an office that has a unique power — and that its occupants have a limited time to get things done.

He recalled that an aide had cautioned Johnson against taking on civil rights because it was a lost cause.

“To which, it is said, President Johnson replied, ‘Well, what the hell’s the presidency for?’ What the hell’s the presidency for if not to fight for causes you believe in?” Obama said.

“That was LBJ’s greatness. That’s why we remember him,” Obama added. “With enough effort, and enough empathy, and enough perseverance, and enough courage, people who love their country can change it.”