WASHINGTON — The Supreme Court on Friday agreed to decide cases on the First Amendment rights of groups fighting AIDS and the Fifth Amendment rights of people who refuse to answer questions from the police.

The First Amendment case arose from a 2003 law that requires private groups that receive federal money to combat AIDS abroad to have “a policy explicitly opposing prostitution.” The restriction does not apply to other recipients, including the World Health Organization.

The Supreme Court has said the government may not attach strings to money it provides to some people and groups if those conditions infringe on constitutional rights — even though the government has no obligation to spend the money in the first place.

In 2011, a divided three-judge panel of the United States Court of Appeals for the Second Circuit, in New York, blocked the law, saying it “compels grantees to espouse the government’s position on a controversial issue.” The full appeals court declined to rehear the case. Dissenting from that ruling, Judge José A. Cabranes wrote that the measure was “an uncomplicated and common-sensical condition of federal funding.”