Days after mass shootings in both of his hometowns, President Barack Obama urged his most ardent supporters Saturday "to get back up and go back at it" and help push stalled legislation out of Congress so dangerous people won't get their hands on guns.

"We can't rest until all of our children can go to school or walk down the street free from the fear that they will be struck down by a stray bullet," Obama said in a keynote speech to the Congressional Black Caucus Foundation's annual awards dinner.

Legislation calling for expanded background checks failed to clear the Senate earlier this year despite a strong push by Obama, Vice President Joe Biden, people whose loved ones had been killed by gunfire and other gun-control advocates.

The bill was part of a package of measures Obama promised to put the full weight of his office behind after 20 first-graders and six educators were killed last December in a mass shooting at an elementary school in Newtown, Conn.

Republicans and some Democrats voted against the measure.

Obama used the occasion of his keynote speech to make his first public comments about this week's pair of shootings.

Just two days ago in his other hometown of Chicago, 13 people out watching a game of pickup basketball at a neighborhood park were wounded by gunfire, including a 3-year-old boy.

This past Monday in Washington, 12 people were slain by a gunman who later was killed by police. Obama was preparing to speak Sunday evening at a memorial service in Washington for victims of that shooting.

"Tomorrow night I'll be meeting in mourning with families in this city who now know the same unspeakable grief of families in Newtown and Aurora and Tucson and Chicago and New Orleans and all across the country, people whose loved ones were torn from them without headlines sometimes or public outcry," Obama said.

"But it's happening every single day," he said. "We fought a good fight earlier this year, but we came up short and that means we've got to get back up and go back at it because as long as there are those who fight to make it as easy as possible for dangerous people to get their hands on a gun, then we've got to work as hard as possible for the sake of our children. We've got to be ones who are willing to do more work to make it harder."

The White House said after Monday's shooting that Obama is using his executive authority to tighten access to guns and remains committed to strengthening gun laws, including requiring background checks for sales online and at gun shows.

The dinner celebrated the "Spirit of 1963," including the civil rights movement and the March on Washington for Jobs and Justice led 50 years ago at the Lincoln Memorial by Martin Luther King Jr. The annual event also celebrated the advances the movement brought about for black Americans, including voting rights, desegregation and Obama's election in 2008 as America's first black president.

Without mentioning his place in history, Obama acknowledged progress made since 1963 but said there was more to be done. He spoke of work needed to reduce an unemployment rate among blacks that is twice that of whites, increase the minimum wage as he proposed earlier this year and provide health care and education for all.

He said upward mobility has slipped out of reach for too many Americans, including in largely black communities.

Obama said the U.S. must become a place where hard work buys a ticket into the middle class. He suggested continuing to follow the example of the civil rights heroes of the past and not letting up until that dream also becomes a reality.

"We must make this country a place where anyone who works hard can earn their way into the middle class," Obama told hundreds of people packed into a cavernous ballroom in Washington's convention center. "And until we do, we can't let up and we can't rest."