Vice Media, the insurgent media brand known for its arch take on youth culture and entertainment, has acquired the women’s lifestyle publisher Refinery29.

The deal is valued at about $400 million and includes mostly stock with some cash, according to two people familiar with the transaction who requested anonymity because they were not authorized to speak publicly.

Refinery29 publishes entertainment content aimed at women, an audience Vice lacks, and also runs a lucrative events business. The company had been looking for possible buyers for the last few years as it faced a tough business environment. The digital media industry is dominated by Google and Facebook, which together take more than 60 percent of online advertising revenue.

Nancy Dubuc, the chief executive of Vice, called the merger “a transformative day” in a note sent to the staff Wednesday.