[subject] + 居然 + [verb phrase]
[subject] + 居然 + [adjective]
居然 marks something the speaker finds hard to believe. It goes after the subject and before the verb, like 竟然, and means the same. 居然 is the more spoken of the two and often carries more feeling – delight, or indignation.
It often pairs with 连…都 or with a number that seems too large or too small.
The two look alike and mean opposite things. 居然 is "against all expectation"; 果然 is "just as expected".
居然 only reacts to a surprise. 反而 says the result went the opposite way from what the first clause should have caused.