When Ben Altif got engaged to his first cousin Mazal, there was no problem winning the blessing of their families or the Samaritan high priest, who leads their ancient Israelite sect. Marriage between cousins is common in the religious community.
But there was still an obstacle. Like many Samaritan couples today, the pair had to pass a premarital genetic screening to predict the likelihood of having healthy children. Without the green light from doctors, the marriage would be off.
"Doctors said OK, and now we have a healthy, handsome boy," said Altif, 33, reaching for his wife's mobile phone to show off pictures of his son.
Samaritans, who trace their roots back about 2,700 years, are best known for clinging to strict biblical traditions that have largely disappeared, including animal sacrifice, isolation of menstruating women and, until recently, a ban on marrying outsiders.
But after facing near-extinction and being devastated by a high rate of birth defects because of inbreeding, the community is using modern science - including genetic testing, in vitro fertilisation and abortion - to preserve their traditional way of life.
"It's changing our blood," said Aharon Ben-Av Chisda, 86, high priest of the 750-member Samaritan community, which is split about evenly between the West Bank village of Kiryat Luza, near Nablus, and the Israeli city of Holon, south of Tel Aviv.
The white-bearded priest said genetic testing was breathing new life and optimism into the once-besieged community. He noted that he and his wife, who is a second cousin, had four children before genetic testing was available: three are deaf and one cannot walk.
Most other families at Mount Gerizim tell similar stories of health problems and disabilities among the older generation, though lately such problems have begun to disappear.
Samaritans are one of the world's oldest religious sects. Similar in practice, beliefs and ancestry to Jews, they follow the Hebrew Torah. But instead of Jerusalem, they revere a temple their ancestors built on this remote West Bank hillside.
Mentioned several times in the Bible, Samaritans are also considered one of the most inbred communities in the world, with 46 per cent marrying first cousins and more than 80 per cent marrying blood relatives, according to research by Israeli geneticist Batsheva Bonne-Tamir, who spent most of her career studying the community.
The restrictions against marrying outsiders were less of a problem when Samaritans numbered more than one million in the fifth century. But because of persecution and forced conversion to Islam, their numbers had dwindled to just 146 by 1917.
To crawl their way back, Samaritans began having large families of eight to 10 children, and the frequency of first-cousin marriages doubled, Bonne-Tamir found.
As the population grew, so did the health problems and genetic defects, including rare blood diseases, Usher syndrome, deafness, muteness, blindness and physical disabilities.
Over the last decade, the community also relaxed its restrictions on intermarriage, allowing in about 25 women.
And since adopting genetic testing, Samaritans say the rate of birth defects among newborns today is normal, even though most people still marry inside the community, including to relatives.
"This is enabling us to build a better generation for the future," said Ishak Al Samiri, a spokesman for the community.