All composers draw upon various musical styles. Very few are completely original. The challenge is to fashion the diverse influences into a distinctive voice. It is hard to describe what makes a composer’s voice authentic. But you know it when you hear it.

Nico Muhly has a voice, a Muhly sound, and it came through consistently in his opera “Two Boys,” a dark, ambitious and innovative work that had its much-anticipated American premiere on Monday night at the Metropolitan Opera. With a libretto by the acclaimed playwright Craig Lucas, the opera tells a story, based on real-life events 10 years ago in Manchester, England, of a 16-year-old boy who nearly killed a younger boy, egged on, the attacker claimed, by mysterious people he encountered in a chat room on the Internet.

Commissioned by the Met, “Two Boys” was given its premiere in London in a coproduction with the English National Opera in 2011 and was significantly revised for New York. The director Bartlett Sher’s staging, which employs inventive projections and animation from 59 Productions, is suitably fluid, ominous and shadowy. The dreamlike set by Michael Yeargan consists of movable black walls that slide into positions and double as projection screens.

Mr. Muhly, just 32, is the youngest composer ever commissioned by the Met. Prior to “Two Boys,” during the James Levine era of more than 40 years, there were only five commissioned operas at the Met. Mr. Muhly’s work originated in the company’s troubled commissioning partnership with the Lincoln Center Theater, begun in 2006. It is the first to make it to a production. So there was inordinate pressure on “Two Boys” to be a success. It must have been deeply gratifying for Mr. Lucas and, especially, Mr. Muhly to receive such an ardent ovation at the end.

I wish I could say that “Two Boys” is that longed-for success. The score, rich with intriguing harmonies and textural intricacy, shimmers in Mr. Muhly’s vivid, subtle orchestration, especially as conducted by the impressive David Robertson. Mr. Muhly has acknowledged many musical influences, including Britten, Meredith Monk, Steve Reich, his mentor Philip Glass and even certain complex modernists. With his keen ear, Mr. Muhly is able to fold these inspirations into his own style.

But having a compositional voice is not enough in the elusive form of musical drama that is opera. The score does not sufficiently penetrate the complex emotions and shocking interactions between the characters in this story, set in 2001. Mr. Muhly excels at conveying the obsessive world of Internet chat rooms, a bazaar of masked identities, sexual yearning and fantasies. Several gripping choral episodes depict a frenetic multiplicity of young people mesmerized by their laptops as they communicate. The choristers sing multilayered babble: catchphrases of conversation in chat lingo; sputtering repetitions of “u there u there” delivered like mumbled mantras; collages of muttered phone numbers.

In London, these choral episodes were thought to be musically engrossing but dramatically inert: with rows of people just staring at laptops. For this staging a roster of dancers has been added, choreographed by Hofesh Shechter. As the choristers sing, the dancers writhe and twist, all undulant slouching with jerky gyrations. The idea is to convey the teeming emotions beneath the numbing chat. I found the dancing distracting and a little forced.

“Two Boys” unfolds like a police procedural. The main character is Anne Strawson, a detective inspector charged with figuring out why the older teenager, here called Brian, stabbed the 13-year-old, Jake, who is comatose in the hospital. Anne’s character was fleshed out after the London premiere and given a more revealing back story. A hard-working, frustrated woman in her 50s, Anne lives with her invalid mother and is loath to face her loneliness. She is essentially computer-illiterate, which is a hard to believe of a detective in 2001. But she is mainly reluctant to take on this case because a boy she gave up at birth for adoption would be the same age as Brian.

The excellent mezzo-soprano Alice Coote sings Anne, and her rich, mellow sound and expressive directness are ideal for the role. Still, there are significant stretches of her part where, over lapping riffs and churning figures in the orchestra, which reveal Mr. Muhly’s debt to Minimalism, Anne sings slow-moving, intoned vocal lines that come across as stiff and plodding. Mr. Muhly too often conveys the drama through murmuring, ritualized episodes rather than activating the words and altering the approach to the vocal writing. I wanted more bursts of conversational dialogue to alternate with the flights of searching lyricism.

The impressive, youthful tenor Paul Appleby gives his all to the role of Brian, a young man struggling with his sexuality who feels oppressed by his well-meaning parents (here Maria Zifchak and Kyle Pfortmiller) and seeks refuge in chat rooms where he can connect with other rootless youths and be what they want him to be. The person who first draws him into the world of Jake is actually Jake’s older sister Rebecca, a tough-taking temptress, sung here with brash coolness by the soprano Jennifer Zetlan.

Though Jake does have an older sister, she is a mousy, young woman who keeps running away from home. It turns out that the lonely, gay and hurting Jake made up the story and surrounded himself with a roster of manipulating figures, including a sexually bold Rebecca, a maniacal “Aunt” Fiona (Sandra Piques Eddy) and a depraved and dangerous gardener, Peter (Keith Miller).

Anne, the detective, finally realizes that Jake lured Brian into carrying out the horrific attack. Both the music and Mr. Lucas’s libretto are fairly convincing at taking us inside the mind of the troubled Jake with his suicidal wish. And it is poignant to see two personifications of Jake. There is the idealized teenager, a lonely, good-looking young man who seeks a romantic connection online, sung here by the boyish and solid baritone Christopher Bolduc in his Met debut; then there is the actual Jake, a timid, nervous, nerdy 13-year-old, sung achingly by the boy soprano Andrew Pulver.

But the opera never satisfactorily illuminates what drives Brian to go so far as to stab Jake viciously. Whole stretches of Brian’s music are impulsive and dynamic. He seems too aware and decent to be manipulated into murdering a boy.

To his credit, Mr. Muhly has avoided the obvious in this score. There is none of the cheap melodrama of Neo-Romantic musical styles that you hear too often in new operas. Mr. Muhly’s musical world in this work is dreamy, hazy and strange. There are wondrous passages, especially the final choral scene with all the main characters, invented and real, taking part, ethereal and shimmering music, reminiscent of a strange church chorale, but with jabs of dissonance. Yet, the dramatic denouement does not feel earned. We are left baffled by this disturbing story.

Overall, though, this was a worthy project for the Met. The subject of the opera is topical and important, though anything about the Internet is in danger of becoming dated quickly. Chat rooms are already kind of passé.

“Two Boys” runs at the Metropolitan Opera through November 14, 212 362-6000, metopera.org