Bangladesh has overtaken China to become the largest denim supplier to the European Union -- a development that would give confidence to the country's garment sector as it looks to hit $50 billion in exports by 2021.

In the January-June period of 2016, Bangladesh exported €567.97 million worth of denim products to the 28-nation bloc -- enough to secure a 21.18 percent market share, the highest.

The country has also become the third largest denim supplier -- after China and Mexico -- to the US.

It exported $186.30 million worth of denim products to the US, registering a 12.03 percent market share, eclipsed only by China (26.04 percent) and Mexico (25.40 percent).

The headway has been possible because of the millions of dollars that the local denim fabrics makers invested to set up state-of-the-art facilities in their plants.

Currently, Bangladesh has 30 denim mills for which investment to the tune of $1 billion was made, said Mostafiz Uddin, managing director of Denim Expert Ltd, a leading denim exporter.

The collective production capacity of the mills is 435 million yards a year, he said.

“Bangladesh could win in the European denim segment not only for the competitive prices, but also for the quality of its products, shorter lead time and better commitment,” said MS Hasan, director of operations of Amber Denim, another major denim maker.

For instance, Amber Denim invested heavily to acquire a modern denim laboratory for testing and certification, which helped in reducing the lead time, he said. In terms of denim sales, the US and the UK are two major markets of Bangladesh.

Almost 70 percent of the population in the US wear denim products regularly, according to industry insiders. An average consumer owns seven denim products at any given time, they said.

Over in the UK, one of the largest clothing markets in Europe, each consumer owns an average of 17 denim garments.

Bangladeshi entrepreneurs supply denim products to major global retailers including Levi's, Diesel, G-Star RAW, H&M, Uniqlo, Tesco, Wrangler, s.Oliver, Hugo Boss, Walmart, and Gap.

The denim sub-sector could play a significant role in achieving the $50 billion export target by the end of 2021, said Mostafiz Uddin, who organises denim expositions twice a year in Bangladesh.

Annually 2.1 billion pieces of denim are sold globally, according to Bangladesh Denim Expo, the organiser of the exposition.

In 2014, the size of the global denim market stood at $56.20 billion, Mostafiz said. By 2020, the global denim market will reach $64.1 billion, while Bangladesh's denim export is forecasted to reach $7 billion by the end of 2021.

It is estimated that the global denim market will grow by about 8 percent a year until 2020, Mostafiz said citing data from the Cotton Inc USA.