“There should be no shame around coming out of a store carrying a box of condoms,” declares an ad for Trojan’s newest line of condoms, the aloe-infused, female-marketed XOXO condom. The condom has taken a winding path to social acceptance, though historians can’t pinpoint the date on which the world’s first condom was invented. As the medical historian Vern Bullough writes, the condom’s early history is “lost in the myths of antiquity.”

Animal-intestine condoms have existed since “at least medieval times,” Bullough writes. Other scholars assert that the condom dates back even further, to tenth-century Persia. It was not until the sixteenth century that doctors began suggesting that patients use condoms to prevent diseases. The first physician to do so was the Italian doctor Gabriele Falloppio, who recommended that men wear a lubricated linen condom to guard against venereal disease.

Condoms made from animal intestines—usually those of sheep, calves, or goats—remained the main style through the mid-1800s. Used for both pregnancy- and disease-prevention, these condoms stayed in place with a ribbon that men tied around the bases of their penises. Because they were “widely associated with houses of prostitution,” condoms were stigmatized, Bullough writes. And men didn’t like wearing them. As the famous lover Casanova said in the late 1700s, he didn’t like, “shutting [himself] up in a piece of dead skin in order to prove that [he was] well and truly alive.”

If Casanova had lived to the mid-1800s, he would have had a new type of condom to complain about: the rubber condom. Rubber condoms appeared soon after Charles Goodyear and Thomas Hancock discovered the vulcanization of rubber in the mid nineteenth century. Created around 1858, these early rubber condoms only covered the glans of the penis. They were known in Europe as “American tips.” In 1869, rubber condoms became “full length,” but with a seam down the middle, which made them uncomfortable. Another downside? They were expensive, though their high price was offset by the fact that they were reusable with a little washing. The late 1800s saw the introduction of a cheaper condom: the thin, seamless rubber condom, which had the unfortunate tendency to deteriorate “rather rapidly,” according to Bullough. Joining the seamless rubber condoms were another new type: condoms made from fish-bladders.

The 1873 Comstock Law banned people from sending condoms, contraceptives, and other “immoral goods” through the mail.

Just as condom innovations were on the rise, in 1873, the condom industry hit a snag. American reformer Anthony Comstock got his so-called Comstock Law passed. The Comstock Law banned people from sending condoms—and other contraceptives and “immoral goods,” including sex toys—through the mail. Most states also created their own “mini-Comstock” laws, some of which were stricter. Condoms didn’t disappear, but were forced to go underground. Companies stopped calling their condoms condoms and instead used euphemisms like rubber safes, caps, and gentlemen’s rubber goods.

The Comstock Law also didn’t prevent condom entrepreneurs from entering the business, including two of today’s major condom companies. In 1883, a German-Jewish immigrant named Julius Schmid founded his condom company after buying a sausage-casing business. Schmid named his condoms Ramses and Sheik. By the early 1900s, Schmid was making condoms out of rubber, and his company soon became one of the top-selling condom manufacturers in America, according to the medical historian Andrea Tone. Schmid faced no real competition until 1916, when Merle Young started Young’s Rubber Company and created one of the most successful condom brands in history: Trojan.

The condom business really hit its stride in the 1930s. In 1930, Young sued a competitor for trademark infringement. A federal appeals court ruled that condoms were legal because they had a legitimate use—namely, disease prevention—according to the sociologist Joshua Gamson. Six years later, the condom’s legality was further strengthened when a federal appeals court decided that doctors could legally prescribe condoms to prevent disease.

Around the same time the condom was being legalized, latex rubber was created. Trojans and other condoms became much thinner and more pleasurable to wear. They also became more affordable for the masses. “By the mid-1930s, the fifteen major condom manufacturers were producing one and a half million a day at an average price of a dollar per dozen,” Gamson writes. During World War II, condom production ramped up to 3 million a day, because condoms were given to American troops. The 1940s also saw the introduction of condoms made from plastic and polyurethane (both of which were short-lived) and the first multicolored condom, created in Japan.

Even during the AIDS epidemic, networks continued to ban condom advertising on television.

Condom sales grew until the 1960s and 70s, when “the condom went into a dramatic decline,” Gamson writes. Competition from the pill, which came out in 1960, and from copper and hormonal IUDs, which also debuted around this time, ate into its market share.

Even as the number of contraceptive options expanded, contraceptives remained illegal until 1965, when the Supreme Court, in Griswold v. Connecticut, struck down the ban against contraceptives for married couples. It took seven more years for the Court to grant that unmarried people had the same right. However, condom advertising remained illegal until another Supreme Court decision in 1977. But even when ads became legal, TV networks refused to air them.

Condoms didn’t become popular forms of birth control again until the AIDS epidemic of the 1980s. Yet networks continued to ban condom advertising, even though U.S. Surgeon General C. Everett Koop said that condom ads should be shown on TV (a few PSAs were shown in 1986). Networks feared alienating conservative consumers, many of whom were opposed to birth control. As an ABC executive told the House subcommittee, condom ads violated “standards of good taste and community acceptability.”

TV stations remained squeamish for years. The first national broadcast ad, which was for Trojan condoms, didn’t air until 1991. The ad presented condoms as disease preventatives, not mentioning their contraceptive uses. The same year, Fox rejected an ad for Schmid’s Ramses because the condom featured spermicide. In fact, the first condom ads didn’t air on primetime national TV until 2005. As recently as 2007, Fox and CBS refused to air an ad for Trojans because the ad mentioned the condoms’ contraceptive uses.

So it should come as no surprise that, in 2017, condom ads are still fighting against stigmatization.