diff --git a/scribus/plugins/scriptplugin/cmdpage.cpp b/scribus/plugins/scriptplugin/cmdpage.cpp
index 52ad3f2..7cbec6f 100644
--- a/scribus/plugins/scriptplugin/cmdpage.cpp
+++ b/scribus/plugins/scriptplugin/cmdpage.cpp
@@ -68,6 +68,31 @@ PyObject *scribus_savepageeps(PyObject* /* self */, PyObject* args)
 	return PyBool_FromLong(static_cast<long>(true));
 }
 
+PyObject *scribus_applymasterpage(PyObject* /* self */, PyObject* args)
+{
+	int e;
+	char *name = const_cast<char*>("");
+	if (!PyArg_ParseTuple(args, "esi", "utf-8", &name, &e))
+		return NULL;
+	if(!checkHaveDocument())
+		return NULL;
+	if (!ScCore->primaryMainWindow()->doc->MasterNames.contains(name))
+	{
+		PyErr_SetString(PyExc_IndexError, QObject::tr("Given master page name does not match any existing.","python error").toLocal8Bit().constData());
+		return NULL;
+	}
+	e--;
+	if ((e < 0) || (e > static_cast<int>(ScCore->primaryMainWindow()->doc->Pages->count())-1))
+	{
+		PyErr_SetString(PyExc_IndexError, QObject::tr("Page number out of range.","python error").toLocal8Bit().constData());
+		return NULL;
+	}
+
+	ScCore->primaryMainWindow()->doc->applyMasterPage(name, e);
+
+	Py_RETURN_NONE;
+}
+
 PyObject *scribus_deletepage(PyObject* /* self */, PyObject* args)
 {
 	int e;
@@ -513,5 +538,6 @@ void cmdpagedocwarnings()
 	  << scribus_getVguides__doc__     << scribus_setVguides__doc__
 	  << scribus_pagedimension__doc__  << scribus_getpageitems__doc__
 	  << scribus_getpagemargins__doc__ << scribus_importpage__doc__
-	  << scribus_pagensize__doc__      << scribus_pagenmargins__doc__;
+	  << scribus_pagensize__doc__      << scribus_pagenmargins__doc__
+	  << scribus_applymasterpage__doc__;
 }
diff --git a/scribus/plugins/scriptplugin/cmdpage.h b/scribus/plugins/scriptplugin/cmdpage.h
index c3880d5..792eaaf 100644
--- a/scribus/plugins/scriptplugin/cmdpage.h
+++ b/scribus/plugins/scriptplugin/cmdpage.h
@@ -28,6 +28,15 @@ May raise IndexError if the page number is out of range\n\
 PyObject *scribus_newpage(PyObject * /*self*/, PyObject* args);
 
 /*! docstring */
+PyDoc_STRVAR(scribus_applymasterpage__doc__,
+QT_TR_NOOP("applyMasterPage(masterpage, page)\n\
+\n\
+Apply Master Page to current document\n\
+"));
+/*! apply Master Page */
+PyObject *scribus_applymasterpage(PyObject * /*self*/, PyObject* args);
+
+/*! docstring */
 PyDoc_STRVAR(scribus_actualpage__doc__,
 QT_TR_NOOP("currentPage() -> integer\n\
 \n\
diff --git a/scribus/plugins/scriptplugin/scriptplugin.cpp b/scribus/plugins/scriptplugin/scriptplugin.cpp
index c4233f5..8bea68c 100644
--- a/scribus/plugins/scriptplugin/scriptplugin.cpp
+++ b/scribus/plugins/scriptplugin/scriptplugin.cpp
@@ -281,6 +281,7 @@ char* tr(const char* docstringConstant)
 PyMethodDef scribus_methods[] = {
 	// 2004/10/03 pv - aliases with common Python syntax - ClassName methodName
 	// 2004-11-06 cr - move aliasing to dynamically generated wrapper functions, sort methoddef
+	{const_cast<char*>("applyMasterPage"), scribus_applymasterpage, METH_VARARGS, tr(scribus_applymasterpage__doc__)},
 	{const_cast<char*>("changeColor"), scribus_setcolor, METH_VARARGS, tr(scribus_setcolor__doc__)},
 	{const_cast<char*>("closeDoc"), (PyCFunction)scribus_closedoc, METH_NOARGS, tr(scribus_closedoc__doc__)},
 	{const_cast<char*>("closeMasterPage"), (PyCFunction)scribus_closemasterpage, METH_NOARGS, tr(scribus_closemasterpage__doc__)},
