diff --git a/mwclient/RELEASE-NOTES.txt b/mwclient/RELEASE-NOTES.txt
index ea919561d0809a23e9f7be68bce6ff47d0df289a..3ba95bfc6c047dfeca92cbeefa1d959507057cc9 100644
--- a/mwclient/RELEASE-NOTES.txt
+++ b/mwclient/RELEASE-NOTES.txt
@@ -8,6 +8,7 @@ Mwclient 0.6.4 is unreleased.
 * Added prop=duplicatefiles
 * Properly fix detection of alpha versions
 * Added support for builtin json library
+* Handle badtoken once
 
 == Changes in version 0.6.3 ==
 * Added domain parameter to login.
diff --git a/mwclient/page.py b/mwclient/page.py
index f03de2bee4f7b26f8aa5ca447253774b70a871de..4398b9a279cfef121d70f88d4a25e04a66122e8b 100644
--- a/mwclient/page.py
+++ b/mwclient/page.py
@@ -131,23 +131,38 @@ class Page(object):
 		
 		data.update(kwargs)
 		
-		try:
+		def do_edit():
 			result = self.site.api('edit', title = self.name, text = text, 
 					summary = summary, token = self.get_token('edit'), 
-					**data)
+					**data)		
 			if result['edit'].get('result').lower() == 'failure':
 				raise errors.EditError(self, result['edit'])
+			return result	
+		try:
+			result = do_edit()
 		except errors.APIError, e:
-			if e.code == 'editconflict':
-				raise errors.EditError(self, text, summary, e.info)
-			elif e.code in ('protectedtitle', 'cantcreate', 'cantcreate-anon', 'noimageredirect-anon', 
-				    'noimageredirect', 'noedit-anon', 'noedit'):
-				raise errors.ProtectedPageError(self, e.code, e.info)
+			if e.code == 'badtoken':
+				# Retry, but only once to avoid an infinite loop
+				self.get_token('edit', force = True)
+				try:
+					result = do_edit()
+				except errors.APIError, e:
+					self.handle_edit_error(e, summary)
 			else:
-				raise
+				self.handle_edit_error(e, summary)
+
 		if result['edit'] == 'Success':
 			self.last_rev_time = client.parse_timestamp(result['newtimestamp'])
 		return result['edit']
+	
+	def handle_edit_error(self, e,  summary):
+		if e.code == 'editconflict':
+			raise errors.EditError(self, summary, e.info)
+		elif e.code in ('protectedtitle', 'cantcreate', 'cantcreate-anon', 'noimageredirect-anon', 
+			    'noimageredirect', 'noedit-anon', 'noedit'):
+			raise errors.ProtectedPageError(self, e.code, e.info)
+		else:
+			raise		
 
 	def get_expanded(self):
 		self.site.require(1, 12)