TOKYO—Japanese Prime Minister Shinzo Abe's government on Wednesday said it would impose strict limits on the online sale of some over-the-counter medicines, diluting a pledge to deregulate medical e-commerce and heightening concerns about a broader effort to free up the nation's commerce.

Mr. Abe's effort to wipe out distinctions between online and brick-and-mortar drugstores—one of the few specific pledges he made when he unveiled a sweeping growth strategy in June—has gotten mired down amid safety worries and lobbying...