Ibrahim, who remained unbeaten at 129 off 143 balls, became the first Afghan cricketer to score a century in a World Cup.
In the finishing overs, allrounder Rashid toyed with the Australian bowlers to help Afghanistan go past the 290-mark.
Rashid hit two fours and three sixes in his unbeaten knock of 35 off 18 balls.
This looms as the biggest match in Afghanistan's cricket history as they take on five-time champions Australia to try and stay in the race for a place in the semi-finals.
If Afghanistan can win their two remaining matches at the World Cup, they will qualify for the semi-finals.