The agreement on fighting terrorism came at a two-day meeting of the Malaysia-Indonesia Joint Commission, a senior official told AFP on condition of anonymity.
"On terrorism and militancy, the two countries have agreed to exchange information and to cooperate more closely through their security officials," he said.
The meeting, the first of the joint commission since 1997, was headed by Foreign Affairs minister Syed Hamid Albar and his Indonesian counterpart Hassan Wirayada, who were due to address a news conference later today.
Meanwhile, Malaysian police confirmed that Indonesia's top detective was due here Wednesday for talks expected to focus on cooperation against terrorism.
A national police spokesman said the head of Indonesia's police detective unit, Insp General Engkesmen Hilep, would meet several top Malaysian police officers.
He declined to reveal details of Hilep's arrival or the issues to be discussed, saying the meeting would be "kept secret".
However, reports in Jakarta quoted police chief General Da'i Bachtiar as saying Hilep would visit Malaysia, Singapore and the Philippines to discuss anti-terrorism efforts including the suspected role of Indonesians.
Bachtiar said Hilep would seek permission to question detained Indonesians.
Malaysian police have detained at least five Indonesians suspected of having links to local Islamic extremists in the Kumpulan Mujahidin Malaysia (KMM) and other terror networks, including Osama bin Laden's al-Qaeda.
The government has suggested the KMM has links with militants in Indonesia and the Philippines and together they hoped to create Islamic states in the region.
Malaysia has also identified three Indonesian preachers as responsible for religious and militant indoctrination within the KMM.
One was said to be Ustad Abu Bakar Ba'asyir, who denied during police questioning in Indonesia last month that he was associated with al-Qaeda but hailed bin Laden as "a true Muslim fighter".
The others were Mohamad Iqbal Abdul Rahmat, who was detained here last June, and Reduan Hishammuddin better known as Hambali, whose whereabouts are unknown.
Indonesia, which has the world's largest Muslim population, has come under international pressure to take action against Islamic militants in the same way Malaysia, Singapore and the Philippines have done.
Other points agreed at the Malaysia-Indonesia Joint Commission meeting related to labour, illegal workers and the woes of fishermen.
On labour, Malaysia and Indonesia agreed on the need for a new mechanism for the recruitment of workers, the official told AFP.
Indonesians, who will be restricted to working as maids and plantation labourers after recent riots by industrial workers, would be exposed to Malaysian laws and culture before they begin their work.
The government had yesterday rejected a plea by Indonesia to review the new restrictions on labour.
The official said Prime Minister Dr Mahathir Mohmad would visit Jakarta later this year, adding Indonesia would host a meeting of the joint commission next year.