Uber is settling a discrimination suit by blind passengers with an agreement to carry the passengers’ guide dogs in their vehicles and to fire drivers who refuse, advocates for the blind said over the weekend.

The suit, filed by the National Federation of the Blind in September 2014, said many Uber drivers have refused to take passengers with dogs.

For example, the suit said, one Uber driver agreed by phone to take two passengers to a home in Menlo Park, but when he arrived and saw a guide dog, he shouted, “No dogs,” and sped away. Another driver locked a Sacramento passenger’s guide dog in the trunk, the suit said, and Uber tried to charge cancellation fees to some blind passengers after its drivers refused to transport them.

Uber denied discriminating and said it had a policy of accommodating passengers with disabilities. Uber also argued that, as a ride-hailing service that merely connects drivers and passengers, it wasn’t covered by laws that require taxis and other transportation services to carry a disabled passenger’s service animal.

But a federal magistrate in San Francisco refused to dismiss the suit last year, leading to a settlement before the case was scheduled for trial. With court approval, it will be the first nationwide settlement of a disability suit against such a company, advocates said.

The agreement announced Saturday requires Uber to tell drivers about their obligation to carry guide dogs, the advocacy groups said. They said Uber will also be required to dismiss any driver who knowingly violates that policy a single time, or violates it for any reason more than once.

Uber will also pay the plaintiffs’ legal fees, in an amount yet to be determined.

“Uber and similar services can be a great asset to the blind when they are fully and equally available to us,” Mark Riccobono, president of the National Federation of the Blind, said in a statement.

Michael Hingson, one of the blind plaintiffs, said in a statement through his lawyers that he was “looking forward to being able to use the Uber services when Uber makes the changes needed to fix its discrimination problem.”

Larry Paradis, executive director of the nonprofit Disability Rights Advocates and a lawyer for the passengers, has said his organization is also negotiating with Uber’s competitor, Lyft, without filing a suit. He said Lyft passengers have reported similar problems.

Robert Egelko is a San Francisco Chronicle staff writer. Email: begelko@sfchronicle.com Twitter: @egelko