Sen. John McCain, the Arizona Republican who issued a fatal blow to his party's efforts to repeal and replace portions of Obamacare last month, said on Wednesday he believed that Congress could pass a healthcare bill, but only if lawmakers work openly and in a bipartisan way.

"I still believe we can do that," McCain said in a Facebook Live town hall he held from his office in Phoenix. "I still believe we must do that. One of the reasons Obamacare failed was because it was rammed through the Senate without any Republican consideration. So, what did we do nine years later? ... The same thing to the Democrats. That's not the way the Senate should function."

Some members of Congress are planning to hold bipartisan hearings in September to discuss options for stabilizing the Obamacare exchanges, but divisions have emerged, and the White House is pressuring Republicans to continue working on legislation.

McCain flew to Washington to advance debate on the GOP healthcare bill, but warned from the Senate floor shortly after that he believed the approach Republicans were taking in working on the bill, behind closed doors and only along party lines, was a mistake. He urged them instead to work together.

After 20 hours of debate, McCain issued the determining "no" vote to Republican efforts to repeal and replace portions of Obamacare by voting against a "skinny repeal" bill that would have undone the individual mandate and the employer mandate, and was introduced two hours before the Senate was asked to vote. Republican leaders told rank-and-file members to support it so that differences could be hammered out during conference with the House, but McCain expressed doubts about that approach and ultimately voted against the bill, which also was voted down by GOP Sens. Susan Collins of Maine and Lisa Murkowski of Alaska, as well as all Senate Democrats.

McCain, who took questions from Facebook users during the town hall, lamented that he saw the bill only hours before the Senate was scheduled to vote on it, and he said that he didn't believe working out details during conference was the correct approach.

"I campaigned on repeal and replace," he said. "And I also expected to play a role in the Senate with amendments, with debate and all of the aspects of the formulations of legislation which is characteristic of the Senate."

McCain went on to say that he believed every citizen should have access to healthcare and that he believed the U.S. needed to find a way to protect people with pre-existing illnesses. He said he was against socialized medicine advanced by left-leaning Democrats, saying that it would result in long wait lines for care.

"There is a long list of changes that we can make in order to make healthcare affordable and available to all Americans," he said. "That does not mean leaving Americans behind with the ability to avail themselves of healthcare."

The questions over how to achieve those goals, he said, should be debated openly in Congress.

"Instead, what the Republican leader was trying to do was ram through a bill that none of us had really seen or analyzed and then take it to a conference and then send it back to us with only the choice of yes or no," he said. "My friends, that is not the way the U.S. Senate should function."