Japanese prime minister Junichiro Koizumi and visiting Malaysian prime minister Abdullah Ahmad Badawi on Wednesday agreed in principle on major elements of a bilateral free trade pact during their meeting in Tokyo, Japanese government officials told Kyodo News.