Gedara Wickramanayake and his wife arrived in Maryland from Sri Lanka six months ago, winners of a green-card lottery. He found a job making sandwiches at a Subway shop and was working to ply his trade from back home, heating and cooling work. They planned to start a family.

“They had their whole future set up,” his cousin Indunil Rajapakse said Sunday. “They thought if they came to America that there was a better chance of them having kids.”

Wickramanayake, 41, was gunned down walking home from the sandwich shop March 21. He was the second of two slaying victims in four days in the normally peaceful community of Olney, 10 miles north of the Capital Beltway.

Police say an Olney man with a history of mental illness killed both men, although the reasons for the slayings are still unclear.

Both men were remembered in services over the weekend.

About 200 mourners filled Hines-Rinaldi Funeral Home in Silver Spring on Sunday for Wickramanayake’s service. Seven Buddhist monks chanted as friends and family watched from Sri Lanka over Skype. (Police initially identified him as Punyasara W. Palkumbure Gedara, but a card distributed at the service was printed with his full name, Palkumbure Gedara Punyasara Wickramanayake.)

Wickramanayake’s wife sat amid family members in the front row. She wore a white blouse, white sweater and white skirt.

“I can’t believe he’s gone,” she repeated through tears. In a wood coffin decorated with red roses and white carnations, her husband’s body was dressed in a black suit, white shirt and striped tie.

“He had a way of making everyone happy when he walked in a room,” Rajapakse said during a visitation period. He loved to dance to Sri Lankan music and kept going after others tired. “He said it was good exercise,” Rajapakse said, adding that his cousin also enjoyed playing cricket on weekends.

Wickramanayake and his wife moved in with an aunt and uncle in Olney after arriving in the United States, family members said. At the Subway shop — where he landed his position after walking in, eating a sandwich and filling out an application — he spoke to colleagues in Hindi. It wasn’t his first language, but it made them feel comfortable, according to a co-worker.

Sometime before 4:20 p.m. last Monday, Wickramanayake was shot as he walked home from the Subway. He was about two blocks from his home. He died in a hospital a short time later.

“He was sincere and from the heart in everything,” Rajapakse said. “He was like an older brother to us, and now he’s gone.”

Two days earlier, more than 100 people had gathered at the Muslim Community Center in Silver Spring to remember Nazir Ahmed, 81. The man accused in the killings of Ahmed and Wickramanayake, Rohan J. Goodlett, lived next door to Ahmed.

Ahmed, who was found slain in his second-floor bedroom March 18, was a fixture at the community center.

“Nazir wasn’t anybody’s relative here, but he was everyone’s brother,” said Azad Ejaz, a close friend.

Ahmed, who lived alone, arrived at the center daily, often walked laps around the grounds for exercise and went to prayer services. He’d then take a seat in the center and discuss the issues of the day with friends.

“I called them the McLaughlin Group,” said Ishtiaq Chughtai, another close friend.

During holidays, he was known for giving away 50-cent and $1 coins to others at the center. Family members and friends said the retired engineer required little — food; water, which he believed warded off ailments; and his family and friends.

“My father was a simple man, an elegant, educated man,” his son Arshad Nazir said Friday night.

Nazir recalled a telephone conversation with Ahmed in which he suggested that his father’s health was slipping and told him he should consider moving to the Seattle area to be with his wife and two sons. But his father didn’t want to leave his community at the Muslim center, Nazir said — and besides, he joked, he’d outlive his son anyway.

“I wish he had done that,” Arshad said Friday, his voice cracking.

Staff researchers Magda Jean-Louis and Madonna Lebling contributed to this report.