Virginia “Ginni” Rometty, the ninth chief executive officer in IBM’s 103-year history, is making her way down a long corridor at the company’s headquarters in Armonk, N.Y. To her left, a series of large, gold-framed oil paintings depicting her predecessors—men like Samuel Palmisano, Louis Gerstner, John Akers, and founder Thomas Watson—looms over her, shadows of IBM’s storied past. Dressed in crisp dark suits and ties, the former CEOs gaze at Rometty, the first woman to run the $100-billion-a-year tech giant, as she passes by.

Her ascension to the top job at Big Blue may have made history, but Rometty, 57, doesn’t waste time waxing on about the significance of her glass-ceiling-smashing career. In addition to being the first woman to head IBM, she is one of just 24 female CEOs in the Fortune 500 (for the third year in a row, she also tops Fortune’s list of Most Powerful Women). In fact, Rometty doesn’t waste much time on anything not viewed as essential to “transforming” the company to which she has devoted much of her adult life.

Ginni’s Rules
1. Don’t protect the past.
2. Never be defined by your product.
3. Always transform yourself.

An IBMer since the early ’80s, Rometty assumed the top job in 2012 and has since made a series of sweeping changes. She snapped up cloud-services provider SoftLayer Technologies for $2 billion last year and has pledged to invest $1 billion toward the development and commercialization of Watson, a so-called cognitive-computing system capable of sifting through millions of scientific papers in seconds. She has also sold off some of IBM’s lower-margin businesses, made cuts in its still-massive employee base, and even simplified contracts for clients (bringing down the typical number of pages from 30 to just four).

More recently she has brought the dowdy centenarian IT company into head-turning relationships with some hot California celebrities. Witness its unprecedented alliance with its old rival Apple, announced in July, which will bring IBM services to the iPhone maker’s iOS platform.

“I think she’s wicked smart,” Apple CEO Tim Cook says of Rometty (more on this truly yin-and-yang partnership later). “She has an incredible ability to partner and can make tough decisions and do so decisively. And she sees things as they really are.”

The way things really are can be summed up with one word: challenging. Despite Rometty’s push into explosively growing areas like cloud, mobile, and Watson, IBM’s revenue has shrunk for nine quarters in a row. In its most recent quarter the company reported sales of $24.4 billion, down 2% from the year before. (Annual sales of $99.8 billion in fiscal 2013, meanwhile, were down nearly 5% year-over-year.) Revenues from its three core businesses—services, software, and hardware—have been sluggish or, worse, in a downward spiral. Perhaps most disruptive is that corporate customers are changing their buying habits. More and more of them are opting for a software-as-a-service model instead of investing in clunky, costly hardware that requires armies of consultants just to get up and running.

To complicate things even more, while Rometty is hard at work trying to ramp up growth areas to offset the declines in the company’s core products, she is simultaneously hampered by an aggressive profit road map passed down by her predecessor, Palmisano, who pledged that earnings per share would reach $20 by 2015. (IBM expects $18 in EPS this year.)

“They created a model which the street loved until it hated,” says one Wall Street investor who does not wish to be named. Indeed, since January 2012, when Rometty became CEO, shares of IBM have inched up only 4%, compared with the 58% rise of the benchmark S&P 500 index.

At Apple Inc's headquarters in Cupertino, California on Tuesday, July 15, 2014, Apple CEO Tim Cook and IBM CEO Ginni Rometty announced a global strategic partnership to redefine the way work gets done by transforming the way businesses and employees use mobile technology through a new class of business apps that bring IBM's big data and analytics capabilities to iPhone and iPad. The new mobile business apps for iOS are targeted for specific business opportunities in industries including retail, healthcare, banking, travel and transportation, telecommunications and insurance.OLD RIVALS, NEW PARTNERS: ROMETTY AND APPLE’S TIM COOK TALK THE FUTURE IN CUPERTINO, CALIF. SAYS COOK: “I THINK SHE’S WICKED SMART.”PHOTO: PAUL SAKUMA—AP

Add to these everyday challenges an existential one: the need to bring a starched-shirt company through a massive cultural transformation. Yes, IBM has reinvented itself in the past. But this time around, there isn’t just one technology shift to contend with—as in moving from mainframes to client-server systems—but rather multiple transitions hitting at the same time. There’s the movement to cloud computing, an increasing need for big-data software, and fast-growing demand for mobile and social tools in the workplace. What’s more, IBM now finds itself competing with a slew of new and agile rivals, from Amazon (an online retailer) to Google (a search engine). “Agile” isn’t exactly the word that pops to mind when thinking of IBM, whose leadership team and board of directors have gone largely unchanged for years. (Fun fact: The average age on its 13-person board is 64.)


But if anyone can pull off this metamorphosis, say many insiders and outsiders, it’s Rometty. In wide-ranging interviews with current and former IBMers as well as company observers, analysts, and investors, nearly everyone agreed that Rometty has the right energy—and perhaps more important, the right leadership style—for the job. “She has this unique ability to make you comfortable in the change while still being uncomfortable,” says John Kelly, senior vice president of IBM Research. “It’s really hard to describe.”

Rometty has also shown that she can move fast. She has already realigned the company’s strategic investments, for example. But to succeed, she needs to make even bolder, faster moves. “What’s different from the past—because we’ve lived through every one of these transitions—is the speed at which this is happening,” Rometty says during a recent interview at IBM headquarters. “We have to keep moving at that speed.” Not an easy thing to do when your employee population is bigger than Cleveland.

“This is the time for Rometty to prove wrong the thesis that large enterprises have no chance of surviving through innovation.”
Jeffrey Sonnenfeld, senior associate dean, Yale School of Management

Everything about IBM is big. The hardware, software, and consulting empire, founded as a maker of commercial scales and punch-card tabulators in 1911, employs more than 431,000 workers across the globe. Today the company that Lou Gerstner famously likened to an elephant sells everything from disk storage systems to collaboration software to cloud infrastructure offerings (and thousands of other products). It operates in 170 countries. Its global services arm—which primarily advises companies on how to use their technology—happens to be one of the largest consulting firms in the world. And at 368 acres, even its sprawling, tree-lined campus north of Manhattan is a testament to its size and breadth.

Dressed in a sharp black jacket and skirt, her perfectly coiffed blond hair tucked behind a bejeweled headband (Steve Jobs had the turtleneck; Rometty owns the headband), the CEO sits down to breakfast on a recent Wednesday morning in a room close to her Armonk office. When asked whether IBM does too much, Rometty demurs: “Maybe it’s because I’m used to the scale,” she says, “but I feel it’s very focused, actually—broad, but focused.” Part of that assessment is a reflection of her own reinvention plan for IBM, which involves trying to get the company to concentrate on three core areas—big data, cloud, and what she calls, simply, “engagement” (that is to say, mobile and social technologies).

Many describe Rometty as collaborative and say she is a clear communicator. Tall and striking, she gives off an almost regal air when she walks into a room. She is also surprisingly approachable. “She’s extraordinarily confident and very warm at the same time,” says Ann Winblad, managing director of venture capital firm Hummer Winblad Venture Partners. “That’s very rare.”

Rometty, who started at IBM as a systems engineer 33 years ago, spent decades climbing through the ranks before being picked to run the company in January 2012. “About a year before the transition [from former CEO Palmisano], they brought Ginni out center stage,” says Winblad. “It was very clear she was emerging as the new leader of IBM, and it was interesting for me to witness the handoff and watch her just step forward.”

Step forward—and sharply to the West. Barely weeks into the job, she flew all 17 of her SVPs out to Silicon Valley to meet with top venture capital firms like NEA and Accel Partners—a first for IBM. “You saw the two worlds together, and that was Ginni’s way to say this is really important,” says Claudia Fan Munce, managing director of IBM’s internal venture capital group. “Not only do we need to be buying [startups]—as leaders we need to be very tuned in to what is going on.”

Clear communication inside IBM has also been a big focus for Rometty. At her very first staff meeting after taking over the CEO job, she gathered her SVPs in a company boardroom and told each of them three things he or she did well (and in some cases what each could improve on). The executives were caught off-guard by the unprecedented open airing of feedback. “I had never seen this happen,” recalls Kelly, the head of IBM Research. “She was sending a signal to everybody in the room that you’re part of my team, and, you know, you’re all good at certain things.”

A computer science major in college, Rometty wasted no time reaching out to the company’s legions of engineers too. One of her first orders of business was to deliver a webcast to the company’s 3,000 researchers across the world. “We all listened,” says Dharmendra Modha, an IBM fellow and chief scientist for “brain-inspired computing” who works out of the company’s R&D center in California’s Almaden Valley. “And you know, the first words out of her mouth were, ‘This is a new era of computing—cognitive computing.’” Modha and his colleagues were thrilled. The message was one they hadn’t heard in a while: IBM was going to be a cutting-edge technology company again, not just an army of buttoned-down consultants.

That outreach and vote of confidence probably helped when, several months later, Rometty initiated a reorg of the entire research division for the first time in nearly two decades. IBM’s labs had been categorized under the older, traditional business units like hardware, software, and services. Under the new strategy they are realigned around her three technological pillars—big data, cloud, and engagement.

Rometty has devoted so much time to communication that it’s a wonder she has time for anything else. Last year, for example, she launched an ambitious online education program called Think Academy, available to IBMers and the company’s partners. Topics for monthly classes range from the new era of data security to changing cloud platforms to the infrastructure challenges of Africa—many of which Rometty introduces or teaches herself. And if there’s a Think Academy interview with, say, a CEO of a company that’s using IBM software, count on the interlocutor to be Rometty as well.

“I said, ‘Look, as the company goes through a transformation one more time, every IBMer needs to understand [we] must come together with one single voice for an entire company,’” says Rometty. “When you’re on a scale like we are in 170 countries and hundreds of thousands of people, you have a single point of view.”

Increasingly these days, that point of view is being shaped at trillions of operations per second.

Inside the gleaming glass building at 51 Astor Place—located in the heart of New York City’s Silicon Alley—workers in white hardhats are busy putting the final touches on the four floors that will soon house the newly formed Watson group.

Tables and chairs in the open workspace are on wheels so that staffers can huddle anywhere. Instead of fixed desks, employees will get bright-blue lockers to hold their belongings. The new Watson team digs, which will be ready in October and eventually hold upwards of 600 employees, feels more like a large startup’s headquarters than an IBM office—and that’s the point. IBMers will not only be neighbors to staffers at Facebook (across the street) and Twitter and Google (a few blocks away), but also coexist in what Michael Rhodin, SVP of the Watson group, hopes will be a thriving, dynamic ecosystem of advanced technology and fresh ideas.

“We need to have the block parties and the networking events and all of those things,” says Rhodin. “And we designed the space intentionally so that we could participate that way. I think that’s going to be interesting because that’s not typical for us as a company. It’s another example of how we’re trying to be a little bit different with Watson.”

IBM CEO Ginni Rometty at the IBM event Watson in the Age of Discovery at the Museum of Design in NYC August 29 2014.MICHAEL RHODIN (LEFT), HEAD OF THE WATSON GROUP, AND ROMETTY CONFER WITH DAVID ALDOUS OF SANOFI, A WATSON CLIENT, IN AUGUST.PHOTO BY MARK PETERSON FOR FORTUNE

It’s been more than three years since Watson—the result of decades of research on artificial intelligence and natural-language processing in IBM labs—beat human opponents on an episode of Jeopardy! And since Rometty became CEO, she has made it a priority to transform the question-answering supercomputer from a game-show gimmick to a bona fide business. That has meant testing Watson in real-work environments, such as the New York Genome Center, and opening it up as a platform for which third-party developers can create applications. Earlier this year, Rometty not only made the Watson group a standalone business unit but also announced that she was dedicating $1 billion to its development and commercialization—a sum that includes a $100 million investment fund for startups that develop applications for the powerful computing system.

IBM had spun out new business units in the past, as it did with its global services division, but the practice was rare. With the creation of the Watson group, Rometty oversaw the largest single movement of IBM Research personnel in the company’s history—some 2,000 employees in all—as squadrons of specialists and consulting and sales teams shifted to the new cognitive-computing operation. “Watson is just an early glimpse of what these systems are going to do,” says Kelly. “They’re going to get smarter. They’re going to do deeper reasoning. They’re going to have more senses than just reading. They’re going to see. They’re going to touch. They’re going to feel. And we see no fundamental limits to that capability. None.”

For now, Watson is still being tried out in a handful of different industries, like health care. At Memorial Sloan Kettering Cancer Center in New York City, doctors are training the system to rapidly sift through medical journals and patient data in an effort to help medical professionals choose effective treatment options for cancers. “Watson’s ability to learn on the fly is really unique,” says Craig Thompson, CEO of the hospital and research institution.

But for all its buzz—and its undeniable potential—this new artificial brain of a computing system has yet to move the needle for IBM. Memorial Sloan Kettering, for example, is a partner, not a paying customer. Rhodin says Watson has “dozens” of paying customers, including the Mayo Clinic and USAA, the insurance and financial planning firm for military service members and veterans. “Our internal metric is we look to sign one to two new customers a week,” he says. “That keeps us going, keeps us busy.”

Rometty points out that IBM already ended last year with $16 billion in data analytics sales. (The company doesn’t break down the exact sources of those revenues.) And, she says, Watson is a bet for the long term. In the meantime, she closely manages the new business group’s progress via monthly meetings with its senior leadership team. “It [Watson] will reinvent careers and reinvent industries,” says Rometty. “It is the third era of technology.”

Rometty realizes that despite IBM’s size and technological know-how, it can’t do everything alone. That’s why last July, following about eight months of behind-the-scenes deliberations, she announced that IBM and Apple would partner to develop services optimized for iOS, the iPhone maker’s mobile operating system. As part of the deal, Apple will provide 24/7 support for devices purchased by IBM customers.

“We’re 100% complementary,” says Cook, Apple’s CEO. “Usually you have overlaps and differences of opinion. But we both brought different assets to it. The truth is that neither of us could do this on our own.”

According to Cook, his talks with Rometty were originally focused on a different kind of partnership (he declined to say what was initially on the table). Those plans never materialized, but along the way the two CEOs realized that a partnership to promote mobility in the enterprise made the most sense.

“Watson is just an early glimpse of what these systems are going to do. They’re going to see. They’re going to touch. They’re going to feel. We see no fundamental limits. None.”

“We had tons of meetings, and the good thing about it was the meetings were pretty broad-based—our engineering teams, their engineering teams, our industry leaders, their marketing and developers—as they thought through with us how we were thinking about various apps,” says Bridget van Kralingen, SVP of IBM’s global business services (and No. 33 on Fortune’s list of Most Powerful Women). According to van Kralingen, several large customers have already signed up to co-develop mobile apps along with IBM and Apple. The two companies’ sales teams, meanwhile, have been co-training to make sure they are well-equipped to cross-sell each other’s products. “Most mobile devices are [used for] 60% email,” says Rometty. “That’s why when we did this Apple partnership, we said we could reimagine work. These devices can do way more.”

Perhaps Rometty’s most significant—and necessary—move to date was shelling out $2 billion on cloud-computing player SoftLayer last year, though critics say it’s an acquisition IBM should have made even earlier.

Just months before acquiring SoftLayer, whose technology is now the underpinning of all of IBM’s cloud offerings, the company suffered an embarrassing loss to rival Amazon. In 2013 it was revealed that the e-retailer, not the enterprise giant, had won the bid for a lucrative contract to build and operate a private cloud facility for the CIA. IBM protested the award partly on the grounds that its own bid was $54 million lower than Amazon’s. Again, IBM lost.

“Amazon beat the precursor to SoftLayer, which was what we call SmartCloud Enterprise,” admits Lance Crosby, CEO of SoftLayer, which is still run as an independent company inside IBM. “They simply had a better product at that time.” Rometty, for her part, mostly agrees, conceding that the company could have been better equipped to fight for the CIA contract. “I would say this was a learning experience,” she says. “And in some of the capabilities, I think we had a very good response, but I think some of them would have been even better with SoftLayer.”

Since the CIA contract debacle, however, IBM has invested massively in cloud—not just in acquiring SoftLayer but also in spending $1.2 billion to open 40 new cloud-powered data centers across the globe, including two new secure centers designed specifically for the U.S. government. “If you were to look at IBM’s cloud effort a year ago, it was a nice effort for a traditional IT vendor but not where it needed to be,” says Frank Gens, chief analyst at research firm IDC. “In my mind that all changed when IBM decided to buy SoftLayer and build its cloud deployment on top of world-class cloud infrastructure—one that can actually compete toe-to-toe with other providers.”

Today, IBM has not only SoftLayer’s public cloud capabilities but also a new platform called BlueMix for developers who want to run all sorts of cloud-based apps. “Ginni really understood that we have all of these customers worldwide that have massive investments either in their own data centers or in IBM’s data centers and they want to move to cloud,” says Crosby. “But it’s going to be a journey to get there.”

The company’s cloud revenue is growing, certainly—indeed, at a rate of 69% from 2012 to 2013. But at $4.4 billion, cloud sales are still a small fraction of IBM’s nearly $100 billion in annual revenue. And it’s that scale—in a sense, the challenge of competing against old IBM—that makes Rometty’s job so damn challenging.

Her investments in Watson and the partnerships she has inked on the mobile front have borne fruit, but nowhere near enough to offset the declining revenue across IBM’s larger businesses. At least not yet. Africa, another bet for Rometty (in late 2013 she opened a new IBM research center in Nairobi, the first on the continent) is most likely years, if not decades, away from any return on investment.

In the meantime, it’s unclear when IBM will return to revenue growth (a question Rometty declined to answer). Last April, in an interview with CNBC, investor Warren Buffett—who now owns more than 6.5% of IBM—addressed the company’s decreasing revenue. “It did not strike me as a big surprise—what they reported,” Buffett told his interviewer. “Now, it may be a surprise a year from now, or two years from now.”

How does IBM make money? Big Blue's revenue dipped 5% last year, but the tech giant still raked in nearly $100 billion annually. Here's where most of that money came from.How does IBM make money? Big Blue’s revenue dipped 5% last year, but the tech giant still raked in nearly $100 billion annually. Here’s where most of that money came from.Graphic Source: IBM’s 2013 Annual Report

For all the talk about IBM’s challenges, it’s worth giving at least a nod to the obvious: that wherever the 103-year-old company is heading—either to transformation or irrelevance—it’s not likely to arrive there anytime soon. It still ranks as No. 23 on the Fortune 500 list and is well embedded in the IT infrastructures of many corporations. Its technology, in fact, powers 90% of banks and 80% of airlines across the globe. Moreover, 70% of enterprise data flow through IBM’s systems in some way.

In the age of disruption, however, nobody—and least of all Ginni Rometty—is taking any leadership position, even a bedrock-entrenched one, for granted. Yeah, breaking up with Big Blue is hard to do, but it’s not impossible. And for newer companies—especially those conceived in Silicon Valley—the need for IBM has been replaced by the likes of Amazon’s Web Services and countless smaller developers of cloud-based applications.

The acquisition of SoftLayer—at the time of its purchase, the company had 20,000 clients, many of them startups—should help mitigate that problem to some extent. So should Rometty’s outreach to Silicon Valley via its venture capital arm and its fledgling Watson ecosystem. But some say Rometty could and should do even more. “There are two perceptions of IBM in the Valley,” says Manoj Saxena, a former general manager of IBM and a current venture capitalist with the Entrepreneurs’ Fund. “The first is that we want more from them, and faster. The second is that we didn’t expect [Watson and other emerging technologies] from IBM; we expected it from Google.”

Why should Rometty care about what Silicon Valley thinks? Because that’s where some of the biggest future buyers of enterprise technologies—and potential acquisition targets, customers, and partners—are sprouting up these days. If IBM becomes irrelevant to startups and developers, Rometty’s bets on mobile, cloud, and Watson, which all depend on building out an ecosystem, would be even more challenging to execute quickly. If she can prove that she can play with younger, nimbler companies, she may well succeed. One way or another, this is the corporate juncture that MBA students will look back at and study one day: Call it “the Rometty crossroads.”

“This is a great time for more repositioning,” says Jeffrey Sonnenfeld, a senior associate dean at the Yale School of Management. “This is the time for Rometty to prove wrong the thesis that large enterprises have no chance of surviving through innovation.”

Back at IBM’s headquarters in Armonk, Rometty remains confident that she now has the right pieces in place to execute a transformation. “You know, if I have learned nothing else in all my years here, my biggest lesson is you have to constantly reinvent this company,” says Rometty. “That’s how you get to be 103 years old.”

Whether that centenarian will dance or stumble under its own elephantine weight will be the climax of one of the great business stories of our age.

This story is from the October 6, 2014 issue of Fortune.