BAKARPUR, India — Enemies stand so close along this Kashmir frontier that in good times Indian soldiers can shout across the no man's land and invite Pakistani troops over for lunch.
When the mood sours, they have a clear shot at each other.
These days, something more than decades-old hostilities is separating the antagonists: a 500-mile-long, 12-foot-tall, barbed-wire fence. India is building the barrier in an attempt to seal the rugged frontier against infiltration by guerrillas battling to reunite the Indian-controlled section of Kashmir with that ruled by Pakistan to the west. A small part of Kashmir is under Chinese control.
Pakistan fears that India wants to create what diplomats call new "facts on the ground" and cement the 57-year division of mainly Muslim Kashmir. India insists that it has the right to build the barrier in what it considers an integral part of India.
Unlike a similar barrier being built by Israel to separate it from the West Bank, which has provoked criticism from the Palestinians and other governments, India's fence has drawn little foreign attention. Even Pakistan has been more severe in its public attacks on the Israeli barrier than the Indian one.
As they prepare for the start of landmark peace talks over Kashmir and other issues next month, India and Pakistan are keeping their argument over the fence civil.
The two nations declared a cease-fire between their regular forces in November, and at least on the Bakarpur front, the old notion has proved true: A good fence makes good neighbors.
Last month, soldiers from India's 60th Battalion of the Border Security Force hollered through the barrier, over a deep trench and across the no man's land to invite Pakistanis to come over and celebrate a Muslim festival.
About 100 Pakistani villagers and a few members of Pakistan's paramilitary Rangers force visited the tomb of a Muslim saint and joined Indian forces for lunch, said Inspector Rajinder Kumar, a unit commander of the Indian border force. It was the first time in 17 years that anyone from Pakistan's side of the front line had been allowed to attend, he said.
"After the announcement of the cease-fire, things have been much more friendly," the inspector said.
The mood was a lot more hostile a year ago, when India began building the fence. Most of the work was done during the night to avoid Pakistani fire, said Kashmir Gov. S.K. Sinha, who represents the Indian government in the territory.
Last May, Pakistani troops tried to disrupt construction by opening fire for several hours along the Bakarpur front line and at least two other areas. Kumar said he lost two soldiers to the cross-border fire.
The new barrier consists of two fences with an eight-foot gap in the middle filled with coils of razor-sharp concertina wire. The fence snakes across the divided territory, hugging the Line of Control -- a 1972 cease-fire line that divides the territory -- and zigzagging through barren mountains as high as 12,000 feet.
As construction workers complete a section on plains near Bakarpur, about 25 miles northwest of Kashmir's winter capital, Jammu, Indian soldiers are digging up land mines laid when India and Pakistan almost went to war for a fourth time in 2002.
Local farmers are taking advantage of the peace along the border to open up new feeding grounds for their livestock, such as water buffaloes that graze next to the barbed-wire barrier.
It is an expensive engineering feat, but Indian officials won't say what it cost, or exactly what high-tech equipment is included in the barrier. The plan is to electrify it, which would also be a major accomplishment because many Kashmiris live with only intermittent power, or none.
Sinha didn't want to discuss details such as the planned voltage.
"It will be a shock, but whether it will be fatal or not I cannot say," the governor said. "It is still being worked out."
India has also tested a combination of Israeli and U.S. electronic equipment, such as motion detectors, thermal imaging cameras and unmanned aerial vehicles, or drones, to make it more difficult to slip through the fence.
But an Indian intelligence official said at least some of the remote sensors haven't performed very well under heavy snow and in the freezing temperatures of Kashmir's soaring Himalayas.
The cease-fire may be the most important component of security against guerrilla infiltrators. India has long accused Pakistan of provoking artillery battles as a diversion to help militants cross into Indian-held Kashmir. If peace talks fail, and the cease-fire breaks down, some well-aimed artillery shells could destroy sections of the fence and quickly reopen guerrilla infiltration routes.