TORONTO -- Amazon has apologized to India's foreign minister for selling doormats depicting the Indian flag on the online shopping giant's Canadian website.

The head of the retailer in India sent the apology to External Affairs Minister Sushma Swaraj on Wednesday, according to a tweet by a ministry spokesperson.

The statement, which was posted on Twitter under the verified account of spokesperson Vikas Swarup, said Amazon is committed to respecting the laws and customs in India.

In India, insulting the national flag is punishable with fines and imprisonment.

Amit Agarwal, vice-president and country manager of Amazon India, said in a statement the company "regrets" the sale of the offending items, noting that they were offered by a third-party seller in Canada.

"At no time did we intend or mean to offend Indian sentiments," Agarwal said.

Minister Swaraj had lashed out on Tuesday at Amazon on Twitter, threatening to deny Indian visas to any Amazon employees if the company did not apologize and "withdraw all products insulting our national flag immediately."

"If this is not done forthwith, we will not grant an Indian visa to any Amazon official. We will also rescind the visas issued earlier," Swaraj tweeted.

The Canadian third-party seller -- which also sells mats with other national flags, including the U.S., U.K. and Canada -- removed the Indian-themed product, following Swaraj's Twitter threat.

Swaraj had also ordered the embassy in Canada to take up the matter with Amazon "at the highest level."

Arun Kumar Sahu, acting High Commissioner of India to Canada, said the situation has now been resolved.

When asked if the embassy will pursue any further action, Sahu said from Ottawa there wouldn't be anything to follow. "At least I don't have any instructions on this," he added.

The doormats had outraged many people among the Indian diaspora in Canada, who posted pictures of them on social media and urged the foreign minister to formally object.

Last year, there were protests after the online marketplace offered doormats depicting Hindu gods.

A spokesperson for Amazon Canada declined to provide any additional comment.

In response to EAM @SushmaSwaraj's tweet, @amazon writes to her, expresses regret at hurting Indian sensibilities, pulls offending item pic.twitter.com/tqRcA10CaZ — Vikas Swarup (@MEAIndia) January 12, 2017

With files from The Associated Press