In a job often held by larger-than-life, publicity-hungry men, House Speaker Dennis Hastert distinguished himself instead by his quiet, behind-the-scenes work in pushing the Republican agenda through the US Congress. But Mr Hastert has lately been thrown into the spotlight, accused of looking the other way while Republican congressman Mark Foley sent sexually suggestive messages to teenaged volunteers. The revelations came at the worst possible time for Republicans, with congressional elections to be held in just over two weeks. Republicans were already in danger of losing their majority before the scandal erupted, but now that possibility looks more and more likely. And ironically, Mr Hastert's very loyalty to his party may be the undoing of the Republicans in the upcoming elections. Mr Hastert, 64, is a former high school teacher and wrestling coach from a small Illinois town about 100km from Chicago. He was first elected to the House of Representatives in 1986, and had an undistinguished career as a backbencher for more than a decade. But in 1998, then-speaker Newt Gingrich, a firebrand who had engineered what he called a 'Republican Revolution' four years earlier, abruptly stepped down after the party faired poorly in congressional elections. The first candidate to replace Mr Gingrich became embroiled in an adultery scandal, and this also being the era of former president Bill Clinton's impeachment, the Republicans needed someone inoffensive. Enter Mr Hastert. The Speaker is the leader of the House of Representatives, and second in line to the presidency behind only the vice-president. Like Mr Gingrich or Tip O'Neill, a Democratic Speaker who was a thorn in the side of former president Ronald Reagan throughout his presidency, the seat is often used as a bully pulpit. Mr Hastert, by contrast, does not have a strong public persona and rarely talks to the media. He is an insider, a fierce Bush loyalist who has presided over a nearly unprecedented rise in partisanship and lack of co-operation between the Democrats and Republicans. 'Until the [recent scandal], the proportion of people who'd even heard of Dennis Hastert was just minuscule,' said Barbara Sinclair, a political science professor at the University of California and an expert on Congress. But he has made up for his lack of public stature by deft parliamentary manoeuvring and strong party discipline. 'For the people who count for this - Republicans - he was an effective Speaker, certainly Bush's best ally in the Congress. He passed the legislation that Bush wanted him to pass, with very few exceptions,' Professor Sinclair said. Legislation in the US Congress has to pass both the House and the Senate before it can be signed into law by the president. Often the two chambers pass different versions of the same legislation and have to negotiate to come up with a common bill to send to the president. The House is usually the less moderate chamber, and Mr Hastert has been a master of exploiting its recent conservative bent to the advantage of the most far-right wing of his party. 'His strategy was to get things out of the House in a very conservative form so that when you bargained with the Senate you were in the strongest possible position,' Professor Sinclair said. 'And by and large, he kept his members pretty happy - until recently.' During Mr Bush's first term in office, relations between the House Republicans and the White House were good. But the relationship started to sour in 2005 as Mr Bush attempted to push an unpopular privatisation of the government pension system and approved a contract giving control of US ports to a Dubai-based company, sparking outrage among Republican members of Congress that an Arab company would have control over such a sensitive industry. Mr Hastert attempted to distance himself slightly from Mr Bush on this, but it failed to work. 'When members get unhappy they tend to beat up on their leadership,' Professor Sinclair said. Then in September, it emerged that Mr Foley had for years been making sexual advances towards young male volunteers, known as pages. They go to Washington from high schools across the US to serve for a year. Many later enter political careers. After the initial reports of inappropriate e-mails to one page, many more former pages stepped forward and said Mr Foley had also flirted with them. While some had told supervisors of the attention Mr Foley paid them, others said they kept quiet, intimidated by Mr Foley's power or impressed by his friendliness and the possibility that he could help them get jobs later. Mr Foley has said he did not have sexual contact with any youth while they were in the page programme, and no one has come forward to contradict that. Two former pages said that they did have sex with him after they left the programme, one aged 18 and the other 21. Mr Foley was head of the House Caucus on Missing and Exploited Children, and led the passage of a law making it illegal to prey on children using the internet. When the story became a massive scandal, Mr Foley quickly resigned and announced that he was a gay alcoholic who had been sexually abused by a priest as a youth. On October 2, he said he was checking himself into a rehabilitation clinic and has not been seen or heard from since. With Mr Foley out of the picture, attention quickly focused on the House leadership, in particular Mr Hastert, and how much they knew and when they knew it. And even Mr Hastert's defenders were forced to admit that it appeared he ignored the issue because he did not want to endanger any Republicans. One influential evangelical Christian group said in a letter asking Mr Hastert to resign: 'The bitter irony is that the leaders of a political party that emphasises family values may have deliberately betrayed those values for political gain. This is a moral failure - and a symptom of a Congress that has lost its moral compass.' Mr Hastert claimed that he only knew of the issue when it became public, but gave contradictory and misleading statements about how he found out. He hinted Democratic operatives and liberal financier George Soros may be behind the scandal. Mr Hastert has also accused Mr Soros of taking money from drug cartels. But congressional staff members soon came forward and said Mr Hastert's office was informed as early as 2003 of Mr Foley's interest in male pages, and conservatives - Mr Hastert's power base - quickly turned on him. The Washington Times also called on him to resign: 'Either he was grossly negligent for not taking the red flags fully into account and ordering a swift investigation, for not even remembering the order of events leading up to last week's revelations - or he deliberately looked the other way in hopes that a brewing scandal would simply blow away ... Mr Hastert has forfeited the confidence of the public and his party, and he cannot preside over the necessary coming investigation, an investigation that must examine his own inept performance.' Mr Hastert has refused to step down, arguing it would simply feed into his opponents' desire to bring down the party. 'I'm sure he's convinced he didn't do anything wrong, and I think most [Republican] House members realised it would make things worse for them if they kept calling for him to step down,' said Professor Sinclair. The Republicans' 28-seat House majority is in danger. Several candidates have cancelled appearances with Mr Hastert, believing he is a liability to the party. Whatever happens on November 7, Mr Hastert's time in the House is probably short, though it is likely that he will regain his seat. If the Democrats take a majority, he is likely to resign. If the Republicans do well, he may stay on for one more two-year term, but even before the Foley scandal, he had suggested he was ready to retire.