BRUSSELS — Prime Minister Theresa May of Britain vowed on Thursday to protect the rights of millions of citizens of other European Union countries who are living in Britain after the country withdraws from the bloc.

Mrs. May made the pledge in remarks to the leaders of the other 27 European Union nations at a summit meeting in Brussels. It was intended to allay fears about mass dislocation stemming from Britain’s decision to withdraw.

“The U.K.’s position represents a fair and serious offer,” Mrs. May told the leaders over dinner at the summit talks. She said she wanted to give “as much certainty as possible to citizens who have settled in the U.K., building careers and lives and contributing so much to our society.”

More than three million citizens of other European Union countries live in Britain, while more than one million Britons live in the other 27 nations. Many of these people have formed families and raised children, and have been anxious about their status since the referendum a year ago when British voters decided to leave the union.