BANGKOK — A ceasefire between Thailand and Cambodia came under strain on Wednesday, with both governments reporting sporadic gunfire near disputed border areas despite an agreement brokered earlier this week in Malaysia. Military spokesmen on both sides accused each other of initiating the exchanges.

The truce followed several days of fighting near the Preah Vihear temple and other contested points along the frontier, which left dozens dead and displaced thousands of civilians. Malaysia, as chair of the Association of Southeast Asian Nations, hosted the ceasefire talks that produced the initial agreement.

Thailand's Defence Ministry said its forces had responded only to incoming fire and remained committed to the ceasefire. A spokesman for the Cambodian government insisted its troops had held their positions and blamed Thai units for the renewed shooting near the ancient temple complex.

Regional diplomats warned that the halt in fighting remained precarious without a formal monitoring mechanism. The ASEAN secretariat said it was coordinating with both capitals on arrangements to verify compliance and to allow displaced residents to return safely to their villages.

The International Court of Justice awarded the Preah Vihear temple to Cambodia in 1962 and reaffirmed the ruling in 2013, but sovereignty over surrounding land has remained a recurring source of armed confrontation between the two neighbours.