As the year 1982 began, Harriet Harman had a plan. She was already the parliamentary candidate for the safe Labour seat of Peckham, where her 66-year-old predecessor, Harry Lamborn, had announced he was standing down. If she had a baby now, she could get back to work before the next general election the following year.

Once she was pregnant, she and her partner, the union official Jack Dromey, swallowed their qualms about the patriarchal institution of marriage, “for the sake of my parents and my constituency”. In her memoir, A Woman’s Work, she records the scene at Willesden Register Office, north London, in August 1982: “There was no wedding ring, no white dress, no flowers, no vowing to obey, no father giving me away. Neither my, nor Jack’s, parents were invited.” In fact, there were no guests at all – just two witnesses. Harman wore a hot-pink dress and made no effort to disguise her bump.

Immediately afterwards, the newlyweds set off for La Rochelle in south-western France, with Dromey stopping the car frequently so his new wife could lean out and be sick. Sitting by a lake in the sunshine, they found a three-day-old copy of the Times, which carried the headline: “Labour MP dies”. It was Harry Lamborn.

And so Harman contested the resulting by-election while five months pregnant. She says the campaign of her SDP challenger, Dick Taverne, tried to suggest this was a problem – but the strategy backfired when working-class women in the constituency pointed out that they’d held down a job while raising their children. (Taverne says this claim is untrue, and that in his election night speech he expressed his happiness that Harman’s pregnancy did not stop her being elected. “I did not approve of her political views at the time, which have somewhat changed,” he tells me now. “I have much admired her record since and wish she had become Labour leader. The party would not be in the desperate and tragic state it is now.”)

On election night, Harman ended up babysitting for a woman on the Glebe Estate who had wanted to vote but whose husband was late home from work. “That was just one of so many encounters which reinforced in me the belief that I had a particular mandate from women, and that it mattered to them and was important that I was different from the men,” she writes.

In her Commons office overlooking the chocolate-box grandeur of Big Ben, I ask her if life became easier once she’d arrived in parliament aged 32. In 1982, there were only 19 female MPs: eleven from Labour, and eight from the Conservatives – including Margaret Thatcher. “I was expecting to come in with other women,” she says now. “And then it was me, pushing open that enormous door. You know the doors to the House of Commons, opposite the Speaker? They are so huge and heavy . . . it was like the women’s movement was this irresistible force, but meeting the implacable object of the House of Commons.” She remembers hundreds of men in grey suits, with an average age of 54, surrounding her in her red velvet maternity dress. “It was awful.”

In December 2016, the 66-year-old Harriet Harman became the longest continuously serving female MP. After the 2015 election, there were 191 women on the green benches, including 99 from Labour. Her memoir is one giant rebuke to those who would dismiss efforts for more equal representation as tokenism or anti-meritocratic. There is strength in numbers; the equalities agenda to which Harman has dedicated her life would have faltered without a movement behind it.

***

Harman now occupies a unique position in British politics. There is a faction of the right that finds her more irritating than almost any other politician from the Blair years, possibly because she is still around to annoy them. The work of Quentin Letts of the Daily Mail encapsulates the charge sheet. She is posh: “Educated at St Paul’s, this scion of the Pakenham family has become the Gromyko of Camberwell”. She has aged: “Those cheeks (on her face) have lost some of their usual pouchy pulchritude,” he lamented in 2007. She is humourless and perpetually vexed, “the frumpish Lady Indignant” (2015). And above all, she is Harriet Harperson, “Britain’s most ear-drillingly insistent feminist” (2013).

Over the years, such attacks as these have been counterproductive. Whatever problems other women in the party had with Harman, they could see how unfairly she was treated. And for the next generation, her resilience in the face of endless brickbats was inspiring. Jess Phillips, who was elected the Labour MP for Birmingham Yardley in 2015, opens her book, Everywoman, with Harman warning her that being a public feminist means “you will never be popular”; she says it felt as if the older woman was passing on the baton. A review of both books by Julie Burchill favourably contrasted the “gobby Brummie” Phillips with the “bogus and bossy” Harman. But the 35-year-old says this misses the point. “I get to be me, because she was so derided for so long,” Phillips says. “It’s like: my mum had to moan about the patriarchy, whereas I get to be funny about the patriarchy.”

Phillips says that Harman’s strength came from rejecting the idea that women should be in competition with each other. “She said to me, ‘There’s no need for people to compare us. We’re from different generations. You’re like Deliciously Ella, and I was Delia.’ And it’s true! Like we are using limes now, it feels like we always had coconut milk in our lives, and now people like us can make curries. That’s what Harriet did: she brought flavour to the Labour Party. So now I get to have a cocktail.”

One of the most interesting questions to ask anyone in Labour is this: is Harriet Harman funny? Half of those you ask will say that she is. “She learned how to slay with a joke,” says a former staffer. “At home, she is fun, silly, warm,” says her daughter, Amy. Yet others see someone who has learned to smother her humour for fear of being misinterpreted or dismissed. “Her generation – including Jack – are a bit humourless,” says one woman in the current parliamentary party. “They couldn’t be funny, because ­being Labour was so hard in the 1980s.” ­Alison McGovern, the Labour MP for Wirral South, puts it another way: “Women can’t be funny, because we’re already not taken seriously.”

The other criticism is that Harman is robotic – that she is typical of the control-freakery of the New Labour era, in which ministers were discouraged from thinking for themselves. “I can’t stand her,” one BBC producer told me recently. “She just parrots the line.” I put this to her: isn’t the rise of Donald Trump and Jeremy Corbyn, in their different ways, a reaction against her style of politics? Being loyal to the point of repetition has firmly gone out of fashion. “Yes, but it hasn’t in terms of what makes things work in politics,” she replies, crisply.

That loyalty has led to situations she now finds it uncomfortable to discuss. In her book, she mentions being sent out to defend Gordon Brown after Caroline Flint accused him of using women as “window dressing”. Soon afterwards, the prime minister revealed that – having refused to make Harman deputy PM despite her being deputy Labour leader – he had, in effect, given the job to Peter Mandelson, making him first secretary of state. So Flint was right, wasn’t she? Trying to explain her response, Harman’s already frequent use of the word “like” in conversation steps up a gear. At the end of it, she adds: “I was very careful not to criticise Caroline, and did words like, ‘We all want to make more progress.’”

I ask Flint how she felt about the incident. “Lonely and isolated”, she says. “Everything that Harriet has said since goes some way to vindicating what I was saying – you can have women around the table but unless they have meaningful influence, it feels like you’re there for the appearance only.” Nonetheless, Flint says that their relationship is now positive. “In shadow cabinet [under Ed Miliband], she did try to draw ­attention to some of the issues I was trying to raise about who we’re appealing to.”

For at least a year now, I’ve been putting a startling proposition to former and current Labour politicians, staffers and activists. Is Harriet Harman the most successful left-wing politician of her generation? She has dramatically increased the number of female MPs and ensured that women’s lives and needs are part of the political conversation. The Equality Act 2010, passed in the dying gasps of the Brown government, made significant demands on employers. They were no longer allowed to bar workers from comparing their pay; laws were brought in against age discrimination; positive action was allowed to increase the recruitment of minorities.

Its “Clause One” was so radical that it has still not been enacted. After all, it asked public bodies to strive to “reduce the inequalities of outcome that result from socio-economic disadvantage”. In other words, the public sector would have to take class into account in everything it did. (At the time, the journalist Polly Toynbee called it “socialism in one clause”.)

Harman regrets now that it was never enacted: “It would have been a big signal that class inequality is at the heart of what we’re concerned about.” But getting the bill passed at all was a struggle. Ayesha Haza­rika, who worked as Harman’s special adviser for women, compared the mood in her office to the film Cool Runnings, in which the Jamaican bobsleigh team improbably get to the Winter Olympics. “The civil servants said [the bill] was a mopping-up exercise, and she stood up and told them it wasn’t: it was a once-in-a-generation opportunity to do something radical. Their faces were full of horror and disbelief.” Other parts of Whitehall, particularly the Department for Business, were obstructive. “I came back browbeaten by a load of male special advisers and she would say, ‘Ayesha, we will not take no for an answer.’”

***

Here’s an easy way to wind up a right-winger: tell them that Harriet Harman is an anti-establishment politician. Yes, like Nigel Farage, she is the product of a comfortable home – her father was a doctor and her mother was a lawyer – and attended private school. But during her early career, she challenged the male dominance of parliament, the Labour Party and lobby journalism. She tells me early on in our conversation that she has a challenge she wants to throw down: Labour should publish its gender pay gap. “Let’s not just be [saying] we believe in equality – let’s be prepared to confront what is going on. So in each workplace, the women and the men can see how they’re differently valued.”

Unsurprisingly, this willingness to criticise her own party’s structures has made her enemies. John Prescott couldn’t stand her, muttering as she walked back from winning the Labour deputy leadership that he wouldn’t help her. (By contrast, Alan Johnson – whom she beat by less than 1 percentage point for the role – wrote in his memoir that she was the better candidate.)

Now, she won’t be drawn on what Prescott’s problem was, though she contrasts him unfavourably with Johnson. “Alan is very unusual in that he can see the bigger picture, and knows what is the right thing to do, and the right thing is to pull people together if you’ve lost an election.” She then drops in a casual criticism of the kind that occurred so often in her book, I gave it a nickname: the Harriet drive-by. “And David Miliband didn’t do that.”

It is hard to recall, now that feminism is so mainstream, but during the 1980s Harman was regarded as a dull, single-issue crank. (Her maiden speech in the House was on childcare.) When she called for half of Labour MPs to be female, “all the men felt it was a personal attack on them”. When she returned to work after her first maternity leave, one of her colleagues reported her to the serjeant-at-arms for taking the baby through the division lobby under her coat. She had to explain to the official that, in fact, “I was still fat from being pregnant.” She now says that such behaviour “was like harassment, really” and it made her want to give up. “But I couldn’t leave, because it would have been literally sending out the message that women can’t hack it.”

She describes it as “a bit of a mortification” that the Conservatives have elected their second female leader before Labour has managed a single one. She prefers not to use Theresa May’s name, referring acidly to “her”, and is sceptical of May’s pledge, in her first speech outside Downing Street, to be a champion of equality. “It’s like how I felt when Margaret Thatcher said ‘let there be peace’ when she was causing absolute misery and division within and between communities . . . If you want to change things, and change them for the better, you don’t join the Tory party.” She believes most Conservative attempts to increase female representation spring from the realisation that it’s good PR. In 1997, when 101 female Labour MPs were elected, she says, the Tories realised “they were going to have electoral problems if they looked like the 1950s Politburo and we looked like today”.

Her book is clear on the highs and lows of politics. The lows include her sacking from her first cabinet job, and the highs include the back-room role of solicitor general, improving the conduct of domestic violence and rape trials. She survived the unbroken opposition of the 1980s with her drive intact, but admits that the party is once again in “wilderness years”. She adds: “What we learned in the 1980s is that there’s no point kidding yourself that things are better than they are . . . and you can’t just wait for people to get fed up with the Tories, because people were fed up with the Tories in the 1980s. I mean, Thatcher had become such a hate figure, they even had to get rid of her, but it still didn’t mean people came to us.”

Harman admits she has struggled throughout her career with the idea that she was a bad mother, though the culture of parliament did little to help. In 1989, she took her son to the cinema at half-term, only to receive a pager message asking her to stand in for the shadow health minister Robin Cook in the Commons. She decided not to reply and expected a reprimand when she later told him simply: “I was not available.” Instead he beamed at her and let her go. On her way out, she realised that he had assumed she was having an affair.

The incident taught her two things: first, that no one is indispensable (in the end, Frank Dobson stood in). Second, it showed the double standards of a male-dominated workplace: “It would, in the eyes of my colleagues, have been beyond the pale for me to be absent because of my children, [but] falling down in my duties because of an affair was not only understood by my male colleagues but thoroughly approved of.”

She is still unashamedly maternal. Jess Phillips calls her “the mom of the Labour Party”. (Another female MP describes her as a “queen”, noting that her initials are HRH.) When I spent a day with her in 2015, Harman joked that she had subsumed her hunger for grandchildren into buying two Burmilla kittens, Minky and Silvio. Her daughter, Amy, is a classical musician, her older son, Harry, works at Channel 4, and Joe is a Labour councillor in south London. (The boys have their father’s surname, while Amy is a Harman.) Harman tried to shield them from the press interest in her life, though that wasn’t always possible. “I never found it weird seeing her on TV,” says Amy now. “But once, a classmate said that their dad told them that my mum hated men. And I was like, ‘She likes my brothers and my dad!’”

A frequent criticism is that Harman’s brand of feminism focuses too much on women like her. “She’s always employed women in her office,” says a Labour staffer. “But mostly they are quite privileged. I don’t know if she doesn’t see it, or if she just thinks it’s not her job.” One female Labour MP says “if you’re in her gang, she’s a tiger. But if you’re not, it can be quite brutal.”

Another former staffer describes a story about a Glasgow housing estate that circulated during the Gordon Brown years. “The story is that Harriet is door-knocking and a guy comes to answer in a football shirt, drinking a can of beer. And she asks him what he’s up to, and he says, ‘Watching the horses’. And she replies, ‘Oh, showjumping?’”

The story is almost certainly untrue – it has the same structure as the one told about Peter Mandelson mistaking mushy peas in a chip shop for guacamole – but the person who told it to me said it persisted because of its fundamental truth. Yet even if Harman is posh, she’s not elitist. “I’ve been out with other politicians who wouldn’t have got out of the car in that kind of estate,” he said.

This perception of her class privilege has made her life more difficult. When I ask Alison McGovern why so many people hate Harman, she replies, “There’s a simple answer to that: because she’s a woman. The more complicated answer is: because if you’re a working-class man, you feel she hasn’t struggled in the way you have.” This tension is a running theme between the trade union movement – long dominated by men – and left-wing feminism. “If the Labour Party’s central job is to raise wages at the bottom of the income distribution, right now that’s women,” adds McGovern. “The care sector, the hospitality sector – those are dominated by women.”

This chimes with my memories of shadowing Harman on the much-mocked “Woman to Woman” tour during the 2015 election – you know, the one with the notorious Pink Bus, which she insisted was actually “one-nation magenta”. It felt totally different from the rallies and set-piece speeches that otherwise dominate election campaigns; at one point, we ended up in a café in Leamington Spa, passing round an adorable baby as the child’s mother told us how she was struggling to find work that fitted around her ability to find childcare. Harman listened intently.

***

There is a strange circularity to Harriet Harman’s front-bench career. It began in 1997, under Tony Blair, when she was made minister for social security. From the start, the appointment was troubled. She was also minister for women and equality, and her department resented half her focus being elsewhere. Turf wars broke out: the Home Office wanted to lead on domestic violence, while David Blunkett at Education wanted to be in charge of childcare. Her deputy at Social Security, Frank Field, had been working on benefits reform from the back benches and, Harman says, saw her as a “Blairite loyalist”. It also transpired that Blair had given Field the impression that Harman was merely keeping the seat warm until he could become secretary of state.

Her downfall came through a manifesto pledge: Gordon Brown as chancellor had committed Labour to observing Tory spending limits for the first two years in government. So she had to cut benefits for lone parents by £6 a week. By 1998, in the middle of press reports about her uselessness, she realised she was a dead woman walking. “I could even sense my diary secretary hesitating to schedule appointments,” she writes in the book. She was duly sacked in the next reshuffle. (Frank Field

resigned rather than be moved to another department, and has remained on the back benches ever since.) “What I should have done is made it not just my problem but everybody’s problem,” she says now. “If I’d had the energy and the political experience, I never would have got into that position.”

But fast-forward to the summer of 2015, when Harman – now acting leader – was again confronted with a manifesto pledge to match Conservative welfare cuts. The “benefits cap”, restricting the maximum amount a household can claim, was in Ed Miliband’s programme for government and was incorporated into the Tory welfare bill after he lost the election. Harman decided that the party would abstain on the second reading, call for amendments, and then vote against on the third reading. She intended this to send a signal to the party’s core working-class vote, which felt that Labour was a soft touch on welfare.

The move backfired. The abstention was seized upon by the left in the party to demonstrate that Labour was “pro-austerity” and “Tory-lite”. The leadership contenders in the cabinet had to vote with the whip, while, on the back benches, Jeremy Corbyn was free to oppose the bill at both readings. The decision is often credited with giving him the momentum he needed to win the leadership. (Ironically, Corbyn ordered MPs to vote for triggering Article 50 on its second reading because of a similar political calculation: it was unpopular with Labour members but popular with swing voters.)

Does Harman now regret her decision? “It was jumped on because there was a mood in the party to swing to the left,” she says. If not that issue, she believes that discontent would have crystallised around something else. “A lot of people were disaffected when we were still in government. That had grown, but because we only lost narrowly in 2010, and there was only a coalition, it was masked by people still hoping that we would get in. But once it was evident we weren’t, it was like ‘We told you so’ . . . repressed resentment, anger, disappointment just burst out.”

Ayesha Hazarika believes that there was no right decision: “She felt she was taking a personal hit, but she was trying to show the voters we had listened.” In any case, the mood inside Labour HQ was already bleak. “When Ed Miliband resigned, it was so fast. Ed Balls had lost his seat. We’d lost Scotland. Everyone was in tears in Victoria Street. Harriet said: ‘Go into the bathroom, dry your tears; we’ve got work to do. We’ve got a party to keep together.’ I thought it was harsh but it was so right.” Hazarika ­believes this is why the welfare vote will not cloud Harman’s legacy. “They see her as a trouper, even people who don’t like her.”

Alison McGovern also sees her as someone willing to subsume her ego into a movement. “Harmanism isn’t a thing . . . It’s why she’s been successful, but it’s also why she hasn’t been credited.” Jess Phillips agrees. “Unlike many high-flyers in the Blair government, Harriet has won at politics. With Blair or Brown, their legacies – regardless of the good that they did – are terrible. Look in the Commons and you can physically see the difference made by Harriet.”

Harriet Harman will be in conversation with Jackie Ashley at the Cambridge Literary Festival, in association with the New Statesman, on 22 April 2017.