Microsoft CEO Satya Nadella apologized Thursday night and said he was wrong for saying that women don't need to ask for a raise and should just trust the system to pay them well.

Nadella was blasted on Twitter and in blog posts for his comments, which were made earlier Thursday at an event for women in computing. Tech companies hire many more men than women. And beyond the tech industry, women are typically paid less than men.

He had been asked to give his advice to women who are uncomfortable requesting a raise. His response: "It's not really about asking for the raise, but knowing and having faith that the system will actually give you the right raises as you go along." Not asking for raise, he added, is "good karma" that would help a boss realize that the employee could be trusted and should have more responsibility.

But his comments caused an uproar online, and Microsoft posted a memo from him on its website. In it, Nadella said he answered the question "completely wrong" and that he thinks "men and women should get equal pay for equal work. And when it comes to career advice on getting a raise when you think it's deserved, Maria's advice was the right advice. If you think you deserve a raise, you should just ask."

His interviewer at the event, Maria Klawe, president of Harvey Mudd College and a Microsoft director, had told him she disagreed, which drew cheers from the audience. She suggested women do their homework on salary information and first practice asking with people they trust.

Microsoft CEO Women Need Not Ask for Raise

Microsoft chief executive officer Satya Nadella spoke at an event for women in computing held in Phoenix, saying women don't need to ask for a raise. They should just trust the system, he said when asked to give his advice to women who are uncomfortable requesting a raise. (Manish Swarup/Associated Press)

In an interview with CBC News, Klawe said women are often raised not to ask for things for themselves and that can be a mistake.

"If you don't ask, you generally don't get," she said.

Klawe said she herself had to learn how to negotiate a pay raise during her career.

"I do a lot of coaching to help women ask for raises or get a new position. One of the reasons I do it is I'm so bad at it myself," she said.

Nadella's comments at the event, the Grace Hopper Celebration of Women in Computing, underscored why many see technology companies as workplaces that are difficult to navigate or even unfriendly for women and minorities. Tech companies, particularly the engineering ranks, are overwhelmingly male, white and Asian.

Criticized for their lack of diversity, major companies say they are trying to address the problem with programs such as employee training sessions and by participating in initiatives meant to introduce girls to coding.

Twenty-nine percent of Microsoft's employees are women, according to figures the Redmond, Wash.-based company released earlier this month. Its technical and engineering staff and its management are just 17 per cent female.

That's roughly comparable to diversity data released by other big tech companies this year.

"Without a doubt I wholeheartedly support programs at Microsoft and in the industry that bring more women into technology and close the pay gap," Nadella wrote in his memo to employees.

With files from CBC News